I would like to store the subimages of an image strip into an image array.
To this, I used the following code:
Bitmap[] subimages = new Bitmap[1]; //Is its place in MainForm()? Initializing error! for (byte i=0; i<2; i++) { Rectangle sourceImg = new Rectangle(i*(an_image.Width/2),0,an_image.Width/2,an_image.Height); subimages[i]=an_image.Clone(sourceImg, an_image.PixelFormat); }
I got an initializing error at declaring the Bitmap array and in those line, where the cloning happening.