Updated Source for Image Samples

Updated on 11/10 to fix the ZIP archives and add dependent projects.

In addition to updating the image samples to the final version of Silverlight V2, I’ve also updated the source:

For each of these samples, you’ll need the following project:

Comments (7)

  1. adam11235 says:

    Hi Joe,

    I cannot find the BMPDecoder source that the BMPDecoderSample references..

  2. I updated the Image Source samples to include the BMP Decoder (missing from my previous post).

  3. Michaeljz says:

    Thanks for the example of how to do this.  I also found an example on Ian Griffith’s blog and have built some practice applications using the technique.

    Based on code inspection (not profiling) you could improve the PngEncoder performance substantially by rewriting the ComputeAdler32 function.  It currently performs two modulus operations per byte endoded image (so typically six modulus operations per pixel) which is computationally expensive.  Wikipedia.org has an example of optimized adler32 code — short explanation is to perform the modulus only every 5552 iterations, because s1 and s2 are guaranteed not to overlow a 32bit int until then.

    It’s unfortunate that there isn’t an alternative encoding method to use for PNG.  You need to make three passes through the data — once to copy the pixels which you do in a Write, once to computer adler32, and once to compute CRC.  Not only that, but a change to a small part of the image requires reprocessing all of it for the adler32 computation.


  4. Joe Stegman som arbetar i Silverlight-teamet har satt ihop några demokodsprojekt som visar hur du kan

  5. Apesar de andar muito ocupado nestes últimos dias, com projectos importantes e de carácter importante

  6. Kenny says:

    Hi Joe,

    If I/my workmates want to use your EditableImage and PNGEncoder classes in our company's commercial products, do I/my workmates (or my company) have to pay any fees or royalties to you or anybody else?

    Appreciate your response!