|
-
Oct 17th, 2003, 06:49 AM
#1
AutoRedraw??
Remember VB6's good-old Autoredraw property for forms and pictureboxes etc?
What is the equivalent code in VB.net? I'm trying to draw lines on a form but they wont stay put if I minimize/maximize the form.
I don't live here any more.
-
Oct 17th, 2003, 08:46 AM
#2
Lively Member
I think you can use .Refresh.......I think!
-
Oct 17th, 2003, 09:18 AM
#3
Unfortunately not, that has the opposite effect.
Anyone else?
I don't live here any more.
-
Oct 17th, 2003, 09:59 AM
#4
I wonder how many charact
When you create an instance of the graphics instance, and point it to a form, you are simply drawing on the form. Once the form refreshes, you lose anything you have drawn.
The reason is when the OS or the form event handler tells the form to redraw itself, it only draws what is in its Paint event. If you want something to persist, you must take of it there.
You need to add your own code that basically determines if it should add something to the paint event, or gloss over it.
VB Code:
If _PaintLines Then
'loop through my shapes collection
'and draw them
End If
-
Oct 17th, 2003, 12:00 PM
#5
just to make it more clear
put your draw code in the paint even of the form. This may be sometimes inefficient, as everytime the form is "refreshed" it will redraw everything again. But sometimes this is better, I dont know, depends to you
the other way would be to draw the image on a bitmap or an Image object, and then set that to your form's backgroundImage. If you do this one, you wont have to redraw it. it will just stay there, just as you would have a picture in a picturebox
rate my posts if they help ya!
Extract thumbnail without reading the whole image file: (C# - VB)
Apply texture to bitmaps: (C# - VB)
Extended console library: (VB)
Save JPEG with a certain quality (image compression): (C# - VB )
VB.NET to C# conversion tips!!
-
Nov 15th, 2003, 07:48 AM
#6
That sounds promising, thanks, I'll try it.
I don't live here any more.
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
|