Loading Bitmaps into variables to use with BitBlt

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • AaronL
    New Member
    • Jan 2007
    • 99

    #1

    Loading Bitmaps into variables to use with BitBlt

    Hello,

    I need help with loading bitmaps into variables to be later used as sprites with BitBlt. Here was my original plan but I get an error 91:

    Code:
    Public thePicture as PictureBox
    
    Public Sub LoadPictures()
         
    thePicture.Picture = LoadPicture("c:\thepicture.bmp")
    
    End Sub
    Obviously I'm missing something because I get the object
    variable error 91

    Can someone tell me how to do this right please?

    Thanks!
  • Guido Geurs
    Recognized Expert Contributor
    • Oct 2009
    • 767

    #2
    It works with:
    Code:
    Public thePicture As StdPicture
    
    Public Sub LoadPictures()
       Set thePicture = LoadPicture("c:\thepicture.bmp")
    End Sub

    Comment

    • AaronL
      New Member
      • Jan 2007
      • 99

      #3
      I get user defined type not defined error with StdPicture, this is VB 6.0

      Comment

      • Guido Geurs
        Recognized Expert Contributor
        • Oct 2009
        • 767

        #4
        I'm using VB6 SP6
        You have to insert the reference "OLE Automation" (see attached GIFs)
        Attached Files

        Comment

        Working...