Changing the colour depth of a bitmap when saving

I need to change the colour depth (or PixelFormat) of a bitmap before I save it to a file. I'm guessing it's something to do with EncoderParams, but i'm not having much luck with them...

The bitmap starts off as: PixelFormat.Format32bppArgb

Thanks in advance
saltedAsked:
Who is Participating?
 
AlexFMCommented:
Create another bitmap with same size, and required pixel format. Then create Graphics object from destination bitmap using Graphics.FromImage method, and draw in it source bitmap using Graphics.DrawImage method. This copies source bitmap to destination. Save destination bitmap to file.
0
 
saltedAuthor Commented:
Thanks :)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.