|
-
May 20th, 2004, 04:36 PM
#1
Thread Starter
Frenzied Member
can someone look at this code for me?{resolved}
First of all, what I want to do is draw simple things such as rectangles to a bitmap because, if you use creategraphics() the graphics dissapear after being minimized or moved. I sort of know how to go about doing this but my code is not working. The graphics are not showing up when I try to draw to a bitmap. Here's my code...
Dim bmp As New Bitmap(222, 222)
Dim grfx As Graphics = Graphics.FromImage(bmp)
Dim rect As New Rectangle(123, 211, 80, 90)
grfx.DrawRectangle(Pens.Blue, rect)
Can anyone tell me what I am doing wrong?
Any help is appreciated.
Last edited by System_Error; May 21st, 2004 at 05:22 AM.
-
May 20th, 2004, 04:43 PM
#2
are you actually displaying the bitmap on something? because you won't see the bitmap unless you specify what to display it on.
eg: a picturebox's image ...
VB Code:
Dim bmp As New Bitmap(222, 222)
Dim grfx As Graphics = Graphics.FromImage(bmp)
Dim rect As New Rectangle(123, 211, 80, 90)
Dim p As New Pen(Color.Blue , 5) '/// added this in ( to specify the width of the rectangle also )
grfx.DrawRectangle(p, rect)
PictureBox1.Image = bmp '/// set the image to a picturebox
~
if a post is resolved, please mark it as [Resolved]
protected string get_Signature(){return Censored;}
[vbcode][php] please use code tags when posting any code [/php][/vbcode]
-
May 20th, 2004, 05:00 PM
#3
Thread Starter
Frenzied Member
Thank you very much. I feel really stupid for not knowing that though.
-
May 20th, 2004, 05:03 PM
#4
you are NOT stupid , you are human and we all do these things from time to time
ps. if it's resolved can you add resolved to the topic title
~
if a post is resolved, please mark it as [Resolved]
protected string get_Signature(){return Censored;}
[vbcode][php] please use code tags when posting any code [/php][/vbcode]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|