Click to See Complete Forum and Search --> : BitBlt
Bracol
Jun 14th, 2002, 07:21 AM
I am new with VB and I have been trying to stop my images from flickering with minimal success. I came across a program using the bitblt API but I can't understand what is done for the life of me. Would anyone mind looking at this sample code and comment the lines or something to make it a little easier to understand?
BitBlt Animation (http://caleyscakesandtreats.com/bitbltanimation.zip)
Thank you so much!
Luke1
Jun 14th, 2002, 07:36 AM
Actually if you are stumped with bitblt try paintpicture. Its almost the same thing.
Object.paintpicutre object.hdc,x1,y1,width1,height1,x2,y2,width2,height2,raster
'set autoredraw to true and that should get rid of your flicker
Bracol
Jun 14th, 2002, 07:44 AM
Would you mid telling me what hdc does? In the above program I used a message box and noticed it is always a negative number in the millions but it is random... If it is random then what's it do?
Yhoko
Jun 14th, 2002, 08:00 AM
Why do you say it's random? It simply isn't! hDC is the DC (Device Context) of a picture, you can think of it as a number that allows you to access the picture that is stored somewhere in your memory. You need the DC for any function like BitBlt, TextOut, SetPixel and such.
progeix
Jun 14th, 2002, 08:00 AM
HDC is basically where you want the image to go
in this case, it's the Picturebox..
the HDC is sort of like the picture property...
Jotaf98
Jun 16th, 2002, 04:01 PM
Sorry, I know it's a silly question, but you can use DCs for printers and all... is it really just an image like regular DCs, or can be used for other stuff? No one ever explained that to me, the tutorial I read said "it's kinda like a pointer to the image" and after that I got into DX but now I'm curious :)
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.