tags:

views:

602

answers:

1

I am trying to save images in wpf application, but after saving some reddish tint color is coming on that images and also losing sharpness of those image. I am using PNGBitmapEncoder for that and saving imags in PNG format. I dont know what is happenning.

Anybody Plz give me the solution.. I am trying from so many days. Plz help me regarding this issue.

Thanks in advance

A: 

You'll need to post your code and possibly an example of what the incorrect image looks like.

The most likely explanation is that you've got a mis-match between the order of red green & blue pixels in memory vs what the file format is expected, or that the red value is being increased at the expense of the green & blue somehow.

Are you trying to resize the image as well? That might explain the blurriness.

ChrisF
The code i used to save the images isusing (FileStream outStream = new FileStream(path.LocalPath, FileMode.Create)) { // Use png encoder for our data PngBitmapEncoder encoder = new PngBitmapEncoder(); // push the rendered bitmap to it encoder.Frames.Add(BitmapFrame.Create(renderBitmap)); // save the data to the stream encoder.Save(outStream); }
we are not resizing the image
If you could post the image (or even a link) in the question then that would be really helpful. Could you post the code in the question too.
ChrisF
The code which iam trying to save images is using (FileStream outStream = new FileStream(path.LocalPath, FileMode.Create)) { // Use png encoder for our data PngBitmapEncoder encoder = new PngBitmapEncoder(); // push the rendered bitmap to it encoder.Frames.Add(BitmapFrame.Create(renderBitmap)); // save the data to the stream encoder.Save(outStream); }
i dont know how to post image. for that images i dont have any link.
Hi ChrisF,Give me ur mail Id. sp that i can send images and code too.Its very urgent for me.Plz do the needful.Thanks for ur reply
You can post images on an image sharing site such as http://imgur.com/ and then embed them here or just post a link.
Tiberiu Ana