how to create image manually
-
Hi I would like to draw an image that contains lines , text and rectangles. In order to draw it I need to use the graphics object. Also I would like window\control will handle scroll bar, drawing the image automatically in case the image move with the mouse for example, so I was thinking to use image object in order to store my image How can I export the image I created manually from graphic object (after I create all the items I want such as line, rectangle, etc on panel for example) to image object? Thanks Ronen
-
Hi I would like to draw an image that contains lines , text and rectangles. In order to draw it I need to use the graphics object. Also I would like window\control will handle scroll bar, drawing the image automatically in case the image move with the mouse for example, so I was thinking to use image object in order to store my image How can I export the image I created manually from graphic object (after I create all the items I want such as line, rectangle, etc on panel for example) to image object? Thanks Ronen
You don't need to - just create a new Bitmap, the create a new graphics object, and draw to that e.g. something like
Bitmap bmp = new Bitmap( 640, 480 );
using( Graphics G = Graphics.FromImage(bmp) )
{
G.FillRectangle(...);
}Help me! I'm turning into a grapefruit! Buzzwords!
-
Hi I would like to draw an image that contains lines , text and rectangles. In order to draw it I need to use the graphics object. Also I would like window\control will handle scroll bar, drawing the image automatically in case the image move with the mouse for example, so I was thinking to use image object in order to store my image How can I export the image I created manually from graphic object (after I create all the items I want such as line, rectangle, etc on panel for example) to image object? Thanks Ronen
Hi, you can create a Bitmap, obtain the corresponding Graphics (through Graphics.FromImage), paint to your hearts content, then use Bitmap.Save BTW: there are several articles about Paint-like apps here on CP. :)
Luc Pattyn [Forum Guidelines] [My Articles]
Fixturized forever. :confused:
-
Hi I would like to draw an image that contains lines , text and rectangles. In order to draw it I need to use the graphics object. Also I would like window\control will handle scroll bar, drawing the image automatically in case the image move with the mouse for example, so I was thinking to use image object in order to store my image How can I export the image I created manually from graphic object (after I create all the items I want such as line, rectangle, etc on panel for example) to image object? Thanks Ronen
-
You don't need to - just create a new Bitmap, the create a new graphics object, and draw to that e.g. something like
Bitmap bmp = new Bitmap( 640, 480 );
using( Graphics G = Graphics.FromImage(bmp) )
{
G.FillRectangle(...);
}Help me! I'm turning into a grapefruit! Buzzwords!
OK Thank u all, Itry to draw to bitmap and it work great How can I display it in the form Should I create picturebox control and load the bitmap to it? I would like the form to create scroll bar automaticly if need (in case the form is smaller then the bitmap image) Ronen