Results 1 to 6 of 6

Thread: Stop flickering

  1. #1
    Guest
    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

  2. #2
    New Member
    Join Date
    Jun 1999
    Posts
    15
    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.

  3. #3
    Lively Member
    Join Date
    Oct 1999
    Posts
    65

    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.
    "I'm carrying a Geometry book, but I'm not in Geometry...it's crazy...crazy man!"

  4. #4
    Guest
    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

  5. #5
    Hyperactive Member
    Join Date
    Mar 2000
    Posts
    292
    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.
    "People who think they know everything are a great annoyance to those of us who do."

  6. #6
    Lively Member
    Join Date
    Oct 1999
    Posts
    65
    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.
    "I'm carrying a Geometry book, but I'm not in Geometry...it's crazy...crazy man!"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width