-
I am doing a real basic Screen Saver using a label to display system time. The label of course, bounces all over the screen. The problem is that is flickers so bad. There has to be a way to stop it from flickering? I'm just using a constant while loop, and incrementing the top and left properties of the label by one each iteration.
Thanks,
Shane
-
I have run into the same problem. I am not sure, in fact I hope I am wrong, but I think it is a VB limitation. If you wrote it in a faster language such as C++. I have a DLL written in VB that does sprites & stuff. It has the same problem, but I am hoping to have a friend rewrite it in c++. If it does work better, I will let you know where to get a copy.
-
Well...
I would say to use BitBlt, but I don't have any idea how you would do it on a label. So, no idea.
-
AaronC : Thanks for the input, please do send me that code if you get it.
Apollo : What is BitBlt? Where do I find more info on it?
Thanks,
Shane
-
If this program is going to run full screen and you are also going to be displaying a lot of images BitBlt probably will still be too slow. You might want to try Direct X.
-
This is everything I know about Bit Blit:
Code:
Declare Function bitblt Lib "gdi32" _
Alias "BitBlt" (ByVal hDestDC As _
Long, ByVal x As _
Long, ByVal y As _
Long, ByVal nWidth As _
Long, ByVal nHeight As _
Long, ByVal hSrcDC As _
Long, ByVal xSrc As _
Long, ByVal ySrc As _
Long, ByVal dwRop As Long) As Long
You put all of that in a module. Then:
Code:
YOURIMAGELIST.Listimages( <INDEXNUMBER> ).Draw buffer.hDC, <THE LEFT OF THE INTENDED DRAW POINT> , THE TOP OF THE INTENDED DRAWING POINT, imlTransparent
That's where you specify the source of the image to redraw.
Code:
Dc = bitblt(game.hDC, 0, 0, 480, 480, buffer.hDC, 0, 0, vbSrcCopy)
And the preceding line tells what box to copy the image to, and what buffer to use. I'd reccomend just making a picture box called game, and one called buffer, setting the one called buffer to true and then running the code. The only problem I have with this method, is that I cannot blit into negative space without a crash. This is why I can't make an overworld map... Different story.
If you have any questions on this method, my IM for AIM is AnseImaster.