Results 1 to 12 of 12

Thread: BitBlt

  1. #1

    Thread Starter
    Registered User Nucleus's Avatar
    Join Date
    Apr 2001
    Location
    So that's what you are up to ;)
    Posts
    2,530

    BitBlt

    OK,

    I am scrolling some text in an image control, but it flickers.

    So I BitBlt image1.picture to a second image (image2).

    So I have a buffer that flickers (image1) and a flicker free display (image2)

    Great

    Now the problem, I don't want to display both image1 and image2, and if I hide image 1 then BitBlt doesn't work on the hidden image control.

    Can anyone suggest a solution?

  2. #2
    Megatron
    Guest
    Set the AutoRedraw property to True.

  3. #3

    Thread Starter
    Registered User Nucleus's Avatar
    Join Date
    Apr 2001
    Location
    So that's what you are up to ;)
    Posts
    2,530

    Unhappy

    Thanks for the reply Megatron.

    I tried setting the form's autoredraw property to true, but I am not sure what it was supposed to accomplish?

    Image1 still flickers, BitBlted image2 is perfect, no flicker, but I still have 2 images on display instead of 1 flicker free image

    When I hide image1, then BitBlt doesn't work on it

  4. #4
    Megatron
    Guest
    AutoRedraw preserves the image so that you can copy it, even while it's hidden.

    Also, you're talking about PictureBoxes (not Images) right?

  5. #5

    Thread Starter
    Registered User Nucleus's Avatar
    Join Date
    Apr 2001
    Location
    So that's what you are up to ;)
    Posts
    2,530
    Oops did I say image

    I actually have an image control holding a picture of a border. Inside the image control is a picture box, which has a picture of a man. Inside the picture box is a label over which text is scrolled. Every time the text is scrolled I BitBlt the picture to a second picture box

    The effect is text scrolling directly over the man framed inside a border, which is flicker free after BitBlting.


    Ok, I can now BitBlt the picture box when visible = false, the problem was I was setting the form's autoredraw to true instead of the picture box , ok now that is sorted, cool.

    The only remaining problem is that when I set the the picture box's autoredraw property to true, the label inside the picture box does not get BitBlted even if the picture box is visible.

    Any suggestions to overcome this last hurdle?
    Last edited by Nucleus; Jun 20th, 2001 at 08:49 PM.

  6. #6
    Tygur
    Guest
    Is there any reason not to print the text right onto the picturebox?

  7. #7

    Thread Starter
    Registered User Nucleus's Avatar
    Join Date
    Apr 2001
    Location
    So that's what you are up to ;)
    Posts
    2,530
    Tygur,

    I tried that, except it flickers, not dramatically, it just annoys me. So if I bitblt the picture containing the text being scrolled, no more flicker, and it looks very pro.

    What doesn't look pro, is having both 2 pictures the same side by side, one flickering the other not

    The main reasons for using the label is that you can set the background to transparent which works for scrolling text over an image.

    The only problem is that when the pic box autoredraw is true, the label isn't bitblted with the picture.

    Thanks for having a look!

  8. #8
    Tygur
    Guest
    If I understand correctly, you have one picturebox unseen somewhere with the picture and the text. And you have another one in plain view. You're trying to move the text on the unseen picturebox and then bitblt the moved text with the image behind it onto the visible picturebox.

    Did I get that right?

    If I did, why not print the text onto the invisible picturebox, then bitblt that over to the visible picturebox? Then clear the invisible picturebox (Picture1.Cls, if the image behind the text is in the Picture property, it'll stay) and print the text at the new position. Then bitblt it over again.

    I didn't test that out yet, but it should okay.

  9. #9
    Tygur
    Guest
    ok, I just tested it.

    For me, neither picturebox flickered..

  10. #10

    Thread Starter
    Registered User Nucleus's Avatar
    Join Date
    Apr 2001
    Location
    So that's what you are up to ;)
    Posts
    2,530
    Almost, It is probably easier to show you rather than describe.
    Attached Files Attached Files

  11. #11
    Tygur
    Guest
    I fixed it up so you can hide the back buffer and still see the text. You'll notice that the back buffer doesn't appear to be flickering. I think it might still flicker on other pc's so I suggest going ahead and using bitblt anyway.

    I think I marked off all my changes with comments, but it is possible that I missed something, tho I doubt it.

    I left a comment explaining everything up in General Declarations.
    Attached Files Attached Files

  12. #12

    Thread Starter
    Registered User Nucleus's Avatar
    Join Date
    Apr 2001
    Location
    So that's what you are up to ;)
    Posts
    2,530

    Thumbs up

    Thankyou Tygur!

    Awesome, that was bugging me for a while

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