I'm working on a form which makes use of Bitmap / Graphics objects which I am drawing rectangles onto.
I have to specify a starting size (dimensions) of the Bitmap before I start drawing onto it.
HOWEVER in practise I do not know the resultant size that I need the Bitmap to be until after completion of my processes and establishing dimensions / whereabouts of the rectangles being drawn.
This can result in my intended Bitmap being too small to draw on with some rectangles not seen (as drawn off the edges).
My thoughts on this were to make use of a second Bitmap (after I've established the size as required) and then copy from the first onto the second (with the correct size) in the hope of retrieving the lost graphics.
I've tried doing this as follows :
Bitmap bmp2 = new Bitmap(bmp1, new Size(200, 200));
As my original bitmap is 100x100 the result is that my image appears twice the size.
How can I achieve what I'm trying to do ?
That is, draw onto a bitmap, and then having worked out its dimensions (as determined through processing / drawing of rectangles) create a second and copy the graphics to that - retrieving the lost drawings.
Any help would be appreciated.
Steve
I have to specify a starting size (dimensions) of the Bitmap before I start drawing onto it.
HOWEVER in practise I do not know the resultant size that I need the Bitmap to be until after completion of my processes and establishing dimensions / whereabouts of the rectangles being drawn.
This can result in my intended Bitmap being too small to draw on with some rectangles not seen (as drawn off the edges).
My thoughts on this were to make use of a second Bitmap (after I've established the size as required) and then copy from the first onto the second (with the correct size) in the hope of retrieving the lost graphics.
I've tried doing this as follows :
Bitmap bmp2 = new Bitmap(bmp1, new Size(200, 200));
As my original bitmap is 100x100 the result is that my image appears twice the size.
How can I achieve what I'm trying to do ?
That is, draw onto a bitmap, and then having worked out its dimensions (as determined through processing / drawing of rectangles) create a second and copy the graphics to that - retrieving the lost drawings.
Any help would be appreciated.
Steve