Changing the colour depth of a bitmap when saving

Posted on 2006-04-18
Last Modified: 2012-08-13
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
Question by:salted
    LVL 48

    Accepted Solution

    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.

    Author Comment

    Thanks :)

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
    Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now