|
-
May 25th, 2002, 08:45 AM
#1
Thread Starter
Fanatic Member
Picturebox Redraw Problem
Hi
Because vb.net no longer has a autoredraw property on there picturebox's i had to put all the drawing code into this..
Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
no that works fine, i can move the picturebox off screen, bring it back and it will redraw it self
but it doesnt seem to work when i have the picturebox inside a panel ( which i need because of the scrollbars ). If i scroll the picturebox around using the panels scrollbars its as if the (vb6) autoredraw = false
How can i overcome this problem?
-
May 25th, 2002, 09:18 AM
#2
Lively Member
dont use a panel then, use a another picture box or something ...
-
May 25th, 2002, 10:23 AM
#3
It works great for me. All you need to do is make the PictureBox's SizeMode property Autosize, and the panel's AutoScroll property to true. Then when the picture in the picturebox is larger than the panel, the scrollbars will appear automatically. Just put the top left corner of the picture box in the top left corner of the panel. I have not a single problem with this configuration.
-
May 25th, 2002, 10:51 AM
#4
Thread Starter
Fanatic Member
Sadly i cant use sizemode=autosize because im not using a ready made image
slx47: i have a feeling the same will happen with another picturebox anyway
heres a image showing whats wrong
all the white part around the grid is there because i scrolled the picturebox with the panels scrollbars
but if i move the form off the screen and bring it back again, it will redraw it self correctly
-
May 25th, 2002, 11:21 AM
#5
Member
Visual Basic 6.0, Visual Basic .NET, C#, C++, ASM, HTML
-
May 25th, 2002, 11:24 AM
#6
Thread Starter
Fanatic Member
done it, I had to create a BITMAP variable and do my normal drawing onto that
then on the normal picturebox Paint event, just copy the Bitmap variable to the picturebox.image
works a treat and hardly any flicker
-
May 25th, 2002, 01:15 PM
#7
what's the program you are making anyways?
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!!
-
May 25th, 2002, 01:16 PM
#8
Thread Starter
Fanatic Member
Icon editor, for no reason, just to get practise with vb.net
coming along great
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
|