0
var image = Image.FromFile(@"C:\image.png");

How do I convert this into a Bitmap in rgba32b format?

Paul Knopf
  • 9,568
  • 23
  • 77
  • 142

2 Answers2

1
Bitmap original = new Bitmap(@"C:\image.png");
Bitmap clone = new Bitmap(original.Width, original.Height, System.Drawing.Imaging.PixelFormat.Format32bppPArgb);

using (Graphics gr = Graphics.FromImage(clone)) {
    gr.DrawImage(original, new Rectangle(0, 0, clone.Width, clone.Height));
}
serhiyb
  • 4,753
  • 2
  • 15
  • 24
-1

The Save method can specify the format, so you can just save it out to a memory stream.

SledgeHammer
  • 7,338
  • 6
  • 41
  • 86