VBGamer |
|
Oh, and... Mattman (0 replies, 0 views) (2000-Jun-10) You still should blit to a backbuffer first to stop flickering. To do so, I'm going to assume you're currently blitting to Form1. Create an invisible PictureBox called picBuffer and set its AutoRedraw property to true and its ScaleMode to Pixels. Also make the size of it the same as your form is going to be (whether you just resize it on the form, or do it in runtime using code). Then, before you begin a new scene/frame of animation, you'll need to call up:
picBuffer.Cls
Then, instead of blitting everything to Form1 as you previously did, blit to picBuffer. After everything is blitted onto picBuffer that you want, blit the entirety of picBuffer onto Form1, as follows:
Call BitBlt(Form1.hDC, 0, 0, picBuffer.ScaleWidth, picBuffer.ScaleHeight, picBuffer.hDC, 0, 0, SRCCOPY)
Good luck!
Mattman
<http://www.nobispro.com> |