Extracting bitmaps out of imagelist c#

Paul Kinlan

A visitor to my site entered the search: “extract bitmaps out of imagelist c#”

There are a couple of ways to do this, a simple one is to simply call the Save method on the ImageList Item:

imageList1.Images[i].Save(“c:\test.jpg”, ImageFormat.Bmp);

You could however save it to a Stream, and then manipulate the image as you see fit.

MemoryStream ms = new MemoryStream();
imageList1.Images[i].Save(ms, ImageFormat.Bmp);
byte[] imageBits = ms.ToArray();
//Manipulate data

Paul Kinlan

Trying to make the web and developers better.

RSS Github Medium