Announcement

Collapse
No announcement yet.

LoadBitmap help

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • LoadBitmap help

    Hello all...
    I hate to bug everyone here with my stupid questions but yet again I am stumpped!

    dim BMINFO as BITMAP
    dim hBmp as long

    hBmp = LoadBitmap(hInstance, "button1")
    GetObject(hBmp, sizeof(BMINFO), BMINFO)

    all the members of BMINFO report proper values for the bitmap except for ".bmBits" for some reason this returns zero. This member is supposed to contain the 32bit address for the bitmap pixel data. Am I missing something here?

    Cheers!

  • #2
    I'd say your answer lies in the following WIN32.HLP notes:
    The buffer pointed to by the lpvObject parameter must be sufficiently large to receive the information about the graphics object.
    If hgdiobj identifies a bitmap created by calling CreateDIBSection, and the specified buffer is large enough, the GetObject function returns a DIBSECTION structure. In addition, the bmBits member of the BITMAP structure contained within the DIBSECTION will contain a pointer to the bitmap's bit values.

    If hgdiobj identifies a bitmap created by any other means, GetObject returns only the width, height, and color format information of the bitmap. You can obtain the bitmap's bit values by calling the GetDIBits or GetBitmapBits function.


    ------------------
    Lance
    PowerBASIC Support
    mailto:[email protected][email protected]</A>
    Lance
    mailto:[email protected]

    Comment


    • #3
      Oh... Now I get it!

      Thank you Lance. What docments/help files did that little blurb come from. If I new, I could stop asking DaFt questions. As it turns out, I ended up using code from SMTP.BAS

      Thanks again!
      Cheers!

      ------------------

      Comment


      • #4
        WIN32.HLP comes from:
        http://www.powerbasic.com/files/pub/mstools/win32.zip

        Warning... 8Mb download, but worth every byte!

        ------------------
        Lance
        PowerBASIC Support
        mailto:[email protected][email protected]</A>
        Lance
        mailto:[email protected]

        Comment

        Working...
        X