views:

136

answers:

2

I can save an image to the database streaming it to a byte array using the below code, but when it comes back out it has lost the alpha blending around the image and shows a blocky blue border.

image.Save(stream, image.RawFormat);

How can I get the original picture back out?

A: 

Do you absolutely have to save it as a byte array... I have heard of several issues with trying to do this. What about saving the path and other image information so your application can just get it out of a directory...

J.13.L
Thanks J,I thought about saving path's but I wanted to embed the images (all tiny, 32KB max) in the db for portability purposes.
John B
A: 

Use a specific ImageFormat, e.g.:

image.Save(stream, ImageFormat.Png); 
Jordão