WriteableBitmap Sample


Here’s the source to the WriteableBitmap sample I showed at Mix.  The sample uses WriteableBitmap to take a “snapshot” of the running video to make a thumbnail.  Click on the image below to run the sample.  When running the sample, click on the running video to create a thumbnail.  You can find the video for this sample here.


 


 



WriteableBitmap Image


 


 


The demo shows the following new Silverlight 3 features:


 


·         WriteableBitmap


·         WrapPanel (new SDK control)



Comments (5)

  1. KooKiz says:

    Hi,

    There is a strange behaviour with the writeablebitmap. If I assign the writeablebitmap directly to the source of an image, it works (well, depending on the render tree, but that’s another problem) :

    WriteableBitmap wb = new WriteableBitmap(30, 40, PixelFormats.Bgr32);

    wb.Render(this.sourceImage, new MatrixTransform());

    image1.Source = wb;

    But if I try to read directly the value of the WriteableBitmap pixels, it throws an exception :

    WriteableBitmap wb = new WriteableBitmap(30, 40, PixelFormats.Bgr32);

    wb.Render(this.sourceImage, new MatrixTransform());

    int color = wb[0];

    Is it a normal behaviour or is it because the writeablebitmap isn’t yet fully implemented ?

  2. WzBn says:

    Hi, I’d like to save the image, in this case image1 to the isolatedstorage of the user. Any ideas how to do taht? Thanks

  3. sidd says:

    WriteableBitmap Class Question / building a image editor using WriteableBitmap

    ==============================================================

    I am trying to do following in silverlight…

    1. I need to load a imge.

    2.I want to provide user ability to drag and drop a text box or a image that looks like text box over this image (loaded in point 1 above)

    3. user can type some text in this text box . ability to have graphical fonts will be good.

    4. user can rotate & drag this text box over the image loaded in step 1 above.

    5. finally save all these change along with the image laoded in step 1 as one big image.

    please let me know if this can be done using writablebitmap class in silverlight

    OR

    if there is another class to do this.

    OR if i have to build a applet/activeX control/windows control and embeed that in ASP.net page

    THanks

  4. bagus says:

    how to get pixel in coordinat x,y??