Results 1 to 3 of 3

Thread: [RESOLVED] BitBlt not working?? well... its odd...

  1. #1

    Thread Starter
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Resolved [RESOLVED] BitBlt not working?? well... its odd...

    I have 2 picture boxes.. 1 is the source img (400x40 bmp) the other is destination...

    the BitBlt isnt copying from the pctSrc? its grabbing from the screen!???
    (like the excel grid slides by.. or Outlook.. or whatever the form is over?)

    VB Code:
    1. Private Declare Function BitBlt Lib "gdi32" (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
    2. Const SRCCOPY As Long = &HCC0020
    3.  
    4. Private Sub tmrAni_Timer()
    5.     Dim returnresult&
    6.     Static animationcount&
    7.     'pctAni.Refresh
    8.     returnresult = BitBlt(pctAni.hDC, 0, 0, 40, 40, pctSrc.hDC, animationcount&, 0, SRCCOPY)
    9.     animationcount& = animationcount& + 40
    10.     If animationcount& = (40 * 10) Then animationcount& = 0: countup = 0
    11.     countup = Val(countup) + 1 'counts frames (or sections) cut out of the picturebox
    12. End Sub

    Ive used this before on a 33x20 ani.. (330x20) but this should work!!

    any clue?
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  2. #2
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Re: BitBlt not working?? well... its odd...

    Set the AutoRedraw property of the source picturebox to True.

  3. #3

    Thread Starter
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Re: BitBlt not working?? well... its odd...

    LOL.. just found that and was coming back to mark resolved!
    Thanks!

    now I have a new problem... new post.. lol
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

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