Computer Science Canada Double Buffering in VB6 |
Author: | CodeMonkey2000 [ Tue Sep 11, 2007 4:01 pm ] |
Post subject: | Double Buffering in VB6 |
Is there any way of getting rid of the screen flicker? Also is there a way to take a screen shot of your VB form (similar to turing's pic.new)? |
Author: | CodeMonkey2000 [ Thu Sep 13, 2007 2:58 pm ] |
Post subject: | RE:Double Buffering in VB6 |
No suggestions? |
Author: | Nick [ Thu Sep 13, 2007 3:03 pm ] |
Post subject: | RE:Double Buffering in VB6 |
no idea did u try using the search feature or looking at some tuturials? |
Author: | cpu_hacker4.0 [ Tue Oct 09, 2007 7:17 pm ] |
Post subject: | Re: Double Buffering in VB6 |
yeah ive always wondered about double buffering in vb |
Author: | CodeMonkey2000 [ Tue Oct 09, 2007 7:27 pm ] |
Post subject: | RE:Double Buffering in VB6 |
Apparently you can't, not in VB6 anyway. |
Author: | Euphoracle [ Tue Oct 09, 2007 11:22 pm ] | ||
Post subject: | RE:Double Buffering in VB6 | ||
DoubleBuffering is just drawing to an offscreen image and then drawing that image to the screen at one time, so it's not drawing bit-by-bit, but instead as a whole. I KNOW this is possible because I friend made a "3D" 2D tunnel in VB6 and sent it to me. It's just not given to you like in .Net (You can set Control.DoubleBuffered, which just wraps an offscreen image and sends that to paint instead of the plain Graphics object). Here, I did it in Java (because that's what I'm learning for school) to demonstrate how it can be done manually.
As you can see, this is a very crude example that bases itself off a Panel. paint is an abstract method that is forced to be call. Essentially, all you'd have to do is make a class based on Form, override update to use your doublebuffer, call the base, just to make sure you didn't forget anything, and then draw your image, unless, of course, you can't do any of that in VB6 (the way I described it) in which case: ( X _ x ) Find your equivalent VB6 classes, and code away :V |
Author: | Brightguy [ Sat Oct 13, 2007 7:03 pm ] | ||
Post subject: | Re: Double Buffering in VB6 | ||
Well how about that, I never knew "Double Buffering" had a name... but here's an example of how to do it in classic VB, just change the filename variable to point to a picture.
|
Author: | CodeMonkey2000 [ Sat Oct 13, 2007 8:21 pm ] |
Post subject: | RE:Double Buffering in VB6 |
Wow thanks Brightguy. What's gdi32? Is that like SDL? Can I use SDL instead? |
Author: | rdrake [ Sat Oct 13, 2007 8:28 pm ] |
Post subject: | Re: RE:Double Buffering in VB6 |
CodeMonkey2000 @ Sat Oct 13, 2007 8:21 pm wrote: Wow thanks Brightguy. What's gdi32? Is that like SDL? Can I use SDL instead? Graphical Device Interface. It's used by Windows to draw graphics on the monitor and to output graphics to printers and such. |
Author: | CodeMonkey2000 [ Sat Oct 13, 2007 9:17 pm ] | ||
Post subject: | RE:Double Buffering in VB6 | ||
Why doesn't this work?
|
Author: | Brightguy [ Sun Oct 14, 2007 1:43 am ] |
Post subject: | Re: Double Buffering in VB6 |
A few things: -Make sure ScaleMode is in pixels -Don't use Refresh unless AutoRedraw is true -Button > 1 doesn't recognize left clicks -mousePress will never be true |
Author: | CodeMonkey2000 [ Sun Oct 14, 2007 7:35 am ] |
Post subject: | Re: Double Buffering in VB6 |
Thanks. For those interested, here is a decent reference for gdi32 commands. |