How to? ImageTools Image source = writeablebitmap

Jul 28, 2009 at 5:33 PM

Hey,

How do I set the source of an ImageTools image to a writeablebitmap?

I'm basically trying to use this to convert a writeablebitmap to a .png.

Thank you!

Coordinator
Jul 28, 2009 at 11:15 PM

This is very easy:

(1) Download the last source

(2) Compile the source

(3) Add reference to ImageTools.Util and ImageTools and ImageTools.IO.Png

(4) Add a using to ImageTools

(5) Generate the Image: Image image = myWriteableBitmap.ToImage() or Image image = myCanvas.ToImage();

(6) Save the image, take a look to the short tutorial: http://imagetools.codeplex.com/Wiki/View.aspx?title=Write%20the%20content%20of%20a%20canvas%20to%20a%20file

Jul 29, 2009 at 5:38 PM
malignate88 wrote:

This is very easy:

(1) Download the last source

(2) Compile the source

(3) Add reference to ImageTools.Util and ImageTools and ImageTools.IO.Png

(4) Add a using to ImageTools

(5) Generate the Image: Image image = myWriteableBitmap.ToImage() or Image image = myCanvas.ToImage();

(6) Save the image, take a look to the short tutorial: http://imagetools.codeplex.com/Wiki/View.aspx?title=Write%20the%20content%20of%20a%20canvas%20to%20a%20file

 Awesome! Is it possible to compress the png more?

Thank you for the reply!

Coordinator
Aug 2, 2009 at 8:53 AM

Perhaps, I will have a closer look at the png filters (a step in the encoder before compression), but I recommend to use the JpegEncoder where you can define the target image quality. I dont care about some KBs and dont like Jpeg because the images loose quality, but if it is important for you to have a small image, jpeg is the best for you.