Results 1 to 6 of 6

Thread: BitBlt

  1. #1

    Thread Starter
    Member
    Join Date
    Feb 2002
    Posts
    59

    BitBlt

    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

    Thank you so much!

  2. #2
    Lively Member
    Join Date
    Jun 2002
    Location
    RI
    Posts
    96
    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
    I program in: vb6,vb.net,html,c++,java/script

  3. #3

    Thread Starter
    Member
    Join Date
    Feb 2002
    Posts
    59
    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?

  4. #4
    Member Yhoko's Avatar
    Join Date
    May 2002
    Posts
    47
    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.
    - Yhoko


    Try my Games
    * [VB6] YDK - Yhoko's Development Kit
    * [VB6] HackV1 - two-player puzzle/strategy
    * [VB6] Xen - extended Gen

  5. #5
    Hyperactive Member
    Join Date
    Aug 1999
    Posts
    482
    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...

  6. #6
    Frenzied Member Jotaf98's Avatar
    Join Date
    Jun 2000
    Location
    I'm not gonna give you my IP address! Ok... Portugal, South-Western Europe, 3rd rock from the sun (our star is easy to find, a 47 Ursae Majoris in the Milky Way :p )
    Posts
    1,457
    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
    Code:
    Temp = Me.GetIQ()
    'Error 9: Overflow
    'DON'T PANIC! :eek:

    To learn how to use realistic effects in your games like fire, rain, snow and magic effects, read my article on particles systems here.


    Jotaf's Theories!
    "Cats land on their feet. Toast lands peanut butter side down. A cat with toast strapped to its back will hover above the ground in a state of quantum indecision."

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