I have an array of bitmaps. Now I wil copy a bitmap out the array into an single bitmap.
I create that single bitmap as
Bitmap bmp = new Bitmap( 128, 128 );
Next I copy one of the bitmaps out the arrays like
bmp = Array[4];
But this doesn't work.
Any help please
Loading
WouterPosted Mar 18, 2011, 11:38 AM
VulpesPosted Mar 16, 2011, 5:43 PM
Bitmap bmp = (Bitmap)Array[4].Clone();
There's also an overload of Clone() which can just copy a rectangular section of an existing bitmap to a new one:
Point p = new Point(0, 0);
Size s = new Size(128, 128);
Rectangle rect = new Rectangle(p, s);
PixelFormat pf = Array[4].PixelFormat;
Bitmap bmp = (Bitmap)Array[4].Clone(rect, pf);