Loading ...
Sorry, an error occurred while loading the content.

Re: api call

Expand Messages
  • Rod
    According to MSDN the type value will always be 0, so perhaps nothing is wrong.
    Message 1 of 9 , Apr 28, 2013
    • 0 Attachment
      According to MSDN the type value will always be 0, so perhaps nothing is wrong.
    • Marc
      Good Morning to everybody. I am having tourble with a call to StretchBlt. The compiler says syntax error on the last line. My code follows. Thanks, Marc
      Message 2 of 9 , May 3, 2013
      • 0 Attachment
        Good Morning to everybody.
        I am having tourble with a call to StretchBlt. The compiler says syntax error on the last line.
        My code follows.
        Thanks,
        Marc
        ' code start
        ' *****************************************************************************************************************
        calldll #gdi32, "StretchBlt",_
        hDC as ulong ' the destination dc
        0 as long,_ ' x location of destination
        0 as long,_ ' y location of destination ***********************
        400 as long,_ ' new width desired
        400 as long,_ ' new height desired
        hDCsource as ulong,_ ' the source dc
        0as long,_ ' x location of source rectangle
        0 as long,_ 'y locaton of source rectangle
        widthBitmap,_ ' width of source rectangle
        heightBitmap,_ ' height of source rectangle
        SRCCOPY as ulong,_ ' desired call
        result as Boolean
        ' the last line 'result as boolean' gives me a syntax error
      • Rod
        Two things, SCRCOPY needs a leading underscore and Boolean needs replaced with type long
        Message 3 of 9 , May 4, 2013
        • 0 Attachment
          Two things, SCRCOPY needs a leading underscore and Boolean needs replaced with type long

          --- In libertybasic@yahoogroups.com, "Marc" <mrossi8888@...> wrote:
          >
          > Good Morning to everybody.
          > I am having tourble with a call to StretchBlt. The compiler says syntax error on the last line.
          > My code follows.
          > Thanks,
          > Marc
          > ' code start
          > ' *****************************************************************************************************************
          > calldll #gdi32, "StretchBlt",_
          > hDC as ulong ' the destination dc
          > 0 as long,_ ' x location of destination
          > 0 as long,_ ' y location of destination ***********************
          > 400 as long,_ ' new width desired
          > 400 as long,_ ' new height desired
          > hDCsource as ulong,_ ' the source dc
          > 0as long,_ ' x location of source rectangle
          > 0 as long,_ 'y locaton of source rectangle
          > widthBitmap,_ ' width of source rectangle
          > heightBitmap,_ ' height of source rectangle
          > SRCCOPY as ulong,_ ' desired call
          > result as Boolean
          > ' the last line 'result as boolean' gives me a syntax error
          >
        • Marc Rossi
          Hi again, Rod.  I must have something else wrong with this program.  I admit I never used API calls before.  I enclosed the whole program hoping you can
          Message 4 of 9 , May 5, 2013
          • 0 Attachment
            Hi again, Rod.  I must have something else wrong with this program.  I admit I never used API calls before.  I enclosed the whole program hoping you can highlight the bug,
            Thanks,
            Marc
            ' code start
             

            ________________________________

            From: Rod <rodNOMAINWIN
            WindowWidth = 700
            WindowHeight = 700
            UpperLeftX = (DisplayWidth - WindowWidth )/ 2
            UpperLeftY = (DisplayHeight - WindowHeight )/ 2
            width = 400
            height = 400
            Menu #gwin,"&Program", "&About", [whatabout]
            Menu #gwin, "&Open file", "open", [op]
            Menu #gwin, "&Exit", "&Quit", [quit]
            graphicbox #gwin.gbox, 100, 40, 500, 550
            open "Test BMP" for window as #gwin
            print #gwin.gbox, "trapclose [quit]"
            print #gwin.gbox, "home;fill black"
            wait
            [op]
            filedialog "Open graphics file", "*.bmp", fileName$
            fil$ = fileName$
             
            calldll #user32, "LoadImageA",_
            0 as ulong,_                'instance - use 0 for image from file
            fileName$ as ptr,_         'path and filename of image
            _IMAGE_BITMAP as long,_     'type of image
            width as long,_             'desired width
            height as long,_            'desired height
            _LR_LOADFROMFILE as long,_  'load flag
            fileName$ as Ulong             'handle of loaded image
            loadbmp "f", fileName$     'get the LB loadbmp name
            print #gwin.gbox, "down"
            print #gwin.gbox, "drawbmp f 0 0"
            WindowWidth = 400
            WindowHeight = 400
            UpperLeftX=INT((DisplayWidth-WindowWidth)/2)
            UpperLeftY=INT((DisplayHeight-WindowHeight)/2)
            open "Properties" for text as #prop
            print #prop, "!trapclose [quit1]"


            hBitmap = hbmp("f")
            ' create a struct to old the retrieved info
            STRUCT BITMAP,_
            bmType as long,_
            bmWidth as long,_
            bmHeight as long,_
            bmWidthBytes as long,_
            bmPlanes as word,_
            bmBitsPixel as word,_
            bmBits as long

            nSize = len(BITMAP.struct)  ' returns the length of the struct
            calldll #gdi32, "GetObjectA",_
            hBitmap as long,_   ' handle of object queried
            nSize as long,_  ' number of bytes in struct
            BITMAP as struct,_ ' address of struct
            result as long  ' retrieves the number of bytes retreived, 0 on error

            type = BITMAP.bmType.struct
            width = BITMAP.bmWidth.struct
            height = BITMAP.bmHeight.struct
            widthBytes = BITMAP.bmWidthBytes.struct
            planes = BITMAP.bmPlanes.struct
            bpp =   bmBitsPixel and bmBits'  always return 0
            print #prop, "After API call"
            print #prop, "type of bitmap = ";type
            print #prop, "width of bitmap = ";width
            print #prop, "height of bitmap = ";height
            print #prop, "widthbytes = ";widthBytes
             print #prop, "The = ";bpp
            ' *****************************************************************************************************************
            calldll #gdi32, "StretchBlt",_
            hDC as ulong  ' the destination dc
            0 as long,_  ' x location of destination
            0 as long,_ ' y location of destination ***********************
            400 as long,_  ' new width desired
            400 as long,_  ' new height desired
            hDCsource as ulong,_  ' the source dc
            0 as long,_  ' x location of source rectangle
            0 as long,_   'y locaton of source rectangle
            width,_  ' width of source rectangle
            height,_  ' height of source rectangle
            _SRCCOPY as ulong,_ ' desired call
            result as long
            wait
            [quit1]
            unloadbmp "f"
            calldll #user32, "ReleaseDC",_
            h as ulong,_
            hdc as ulong
            close #prop
            ' close #gwin
            'end
            wait
            [whatabout]
            notice "BMP test"
            wait
            [exit]
            [quit]
            unloadbmp "f"
            close #gwin
            end
            ' code end





            bird@...>
            To: libertybasic@yahoogroups.com
            Sent: Saturday, May 4, 2013 3:21 AM
            Subject: [libertybasic] Re: api call


             


            Two things, SCRCOPY needs a leading underscore and Boolean needs replaced with type long

            --- In mailto:libertybasic%40yahoogroups.com, "Marc" <mrossi8888@...> wrote:
            >
            > Good Morning to everybody.
            > I am having tourble with a call to StretchBlt. The compiler says syntax error on the last line.
            > My code follows.
            > Thanks,
            > Marc
            > ' code start
            > ' *****************************************************************************************************************
            > calldll #gdi32, "StretchBlt",_
            > hDC as ulong ' the destination dc
            > 0 as long,_ ' x location of destination
            > 0 as long,_ ' y location of destination ***********************
            > 400 as long,_ ' new width desired
            > 400 as long,_ ' new height desired
            > hDCsource as ulong,_ ' the source dc
            > 0as long,_ ' x location of source rectangle
            > 0 as long,_ 'y locaton of source rectangle
            > widthBitmap,_ ' width of source rectangle
            > heightBitmap,_ ' height of source rectangle
            > SRCCOPY as ulong,_ ' desired call
            > result as Boolean
            > ' the last line 'result as boolean' gives me a syntax error
            >




            [Non-text portions of this message have been removed]
          • Rod
            Well quite a lot wrong really but that s what basic is all about. You were loading the image as 400x400 I don t think you wanted to do that but perhaps I am
            Message 5 of 9 , May 5, 2013
            • 0 Attachment
              Well quite a lot wrong really but that's what basic is all about. You were loading the image as 400x400 I don't think you wanted to do that but perhaps I am not understanding what you are doing. I have commented the errors I see.


              NOMAINWIN
              WindowWidth = 700
              WindowHeight = 700
              UpperLeftX = (DisplayWidth - WindowWidth )/ 2
              UpperLeftY = (DisplayHeight - WindowHeight )/ 2
              width = 400
              height = 400
              Menu #gwin,"&Program", "&About", [whatabout]
              Menu #gwin, "&Open file", "open", [op]
              Menu #gwin, "&Exit", "&Quit", [quit]
              graphicbox #gwin.gbox, 100, 40, 500, 550
              open "Test BMP" for window as #gwin
              print #gwin.gbox, "trapclose [quit]"
              print #gwin.gbox, "home;fill black"
              wait

              [op]
              filedialog "Open graphics file", "*.bmp", fileName$
              'why are we doing this? fileName$
              fil$ = fileName$
              calldll #user32, "LoadImageA",_
              0 as ulong,_ 'instance - use 0 for image from file
              fileName$ as ptr,_ 'path and filename of image
              _IMAGE_BITMAP as long,_ 'type of image

              ' this may be wrong as you force your image to 400x400
              ' use 0,0 if you want the natural width and height
              width as long,_ 'desired width
              height as long,_ 'desired height
              _LR_LOADFROMFILE as long,_ 'load flag
              ' 'this is wrong
              ' 'fileName$ as Ulong 'handle of loaded image
              fhandle as Ulong ' handle of loaded image

              ' this is wrong
              ' loadbmp "f", fileName$ 'get the LB loadbmp name
              loadbmp "f",fhandle
              print #gwin.gbox, "down"
              print #gwin.gbox, "drawbmp f 0 0"
              WindowWidth = 400
              WindowHeight = 400
              UpperLeftX=INT((DisplayWidth-WindowWidth)/2)
              UpperLeftY=INT((DisplayHeight-WindowHeight)/2)
              open "Properties" for text as #prop
              print #prop, "!trapclose [quit1]"


              ' not needed you know it as fhandle
              hBitmap = hbmp("f")
              ' create a struct to old the retrieved info
              STRUCT BITMAP,_
              bmType as long,_
              bmWidth as long,_
              bmHeight as long,_
              bmWidthBytes as long,_
              bmPlanes as word,_
              bmBitsPixel as word,_
              bmBits as long

              nSize = len(BITMAP.struct) ' returns the length of the struct
              calldll #gdi32, "GetObjectA",_
              hBitmap as long,_ ' handle of object queried
              nSize as long,_ ' number of bytes in struct
              BITMAP as struct,_ ' address of struct
              result as long ' retrieves the number of bytes retreived, 0 on error

              type = BITMAP.bmType.struct
              width = BITMAP.bmWidth.struct
              height = BITMAP.bmHeight.struct
              widthBytes = BITMAP.bmWidthBytes.struct
              planes = BITMAP.bmPlanes.struct
              bpp = bmBitsPixel and bmBits' always return 0
              print #prop, "After API call"
              print #prop, "type of bitmap = ";type
              print #prop, "width of bitmap = ";width
              print #prop, "height of bitmap = ";height
              print #prop, "widthbytes = ";widthBytes
              print #prop, "The = ";bpp

              calldll #gdi32, "StretchBlt",_
              hDC as ulong,_ ' the destination dc
              0 as long,_ ' x location of destination
              0 as long,_ ' y location of destination ***********************
              400 as long,_ ' new width desired
              400 as long,_ ' new height desired
              hDCsource as ulong,_ ' the source dc
              0 as long,_ ' x location of source rectangle
              0 as long,_ 'y locaton of source rectangle
              ' these wre wrong you had missed as long
              width as long,_ ' width of source rectangle
              height as long,_ ' height of source rectangle
              _SRCCOPY as ulong,_' desired call
              result as long

              wait

              [quit1]
              unloadbmp "f"
              calldll #user32, "ReleaseDC",_
              h as ulong,_
              ' hDC?
              hdc as ulong
              close #prop
              ' close #gwin
              'end
              wait

              [whatabout]
              notice "BMP test"
              wait
              [exit]
              [quit]
              unloadbmp "f"
              close #gwin
              end
              ' code end
            • Marc Rossi
              Thanks for going through all that code, Rod.  I really appreciate you looking that over for me. Marc ________________________________ From: Rod
              Message 6 of 9 , May 5, 2013
              • 0 Attachment
                Thanks for going through all that code, Rod.  I really appreciate you looking that over for me.
                Marc


                ________________________________
                From: Rod <rodbird@...>
                To: libertybasic@yahoogroups.com
                Sent: Sunday, May 5, 2013 4:52 AM
                Subject: [libertybasic] Re: api call


                 

                Well quite a lot wrong really but that's what basic is all about. You were loading the image as 400x400 I don't think you wanted to do that but perhaps I am not understanding what you are doing. I have commented the errors I see.

                NOMAINWIN
                WindowWidth = 700
                WindowHeight = 700
                UpperLeftX = (DisplayWidth - WindowWidth )/ 2
                UpperLeftY = (DisplayHeight - WindowHeight )/ 2
                width = 400
                height = 400
                Menu #gwin,"&Program", "&About", [whatabout]
                Menu #gwin, "&Open file", "open", [op]
                Menu #gwin, "&Exit", "&Quit", [quit]
                graphicbox #gwin.gbox, 100, 40, 500, 550
                open "Test BMP" for window as #gwin
                print #gwin.gbox, "trapclose [quit]"
                print #gwin.gbox, "home;fill black"
                wait

                [op]
                filedialog "Open graphics file", "*.bmp", fileName$
                'why are we doing this? fileName$
                fil$ = fileName$
                calldll #user32, "LoadImageA",_
                0 as ulong,_ 'instance - use 0 for image from file
                fileName$ as ptr,_ 'path and filename of image
                _IMAGE_BITMAP as long,_ 'type of image

                ' this may be wrong as you force your image to 400x400
                ' use 0,0 if you want the natural width and height
                width as long,_ 'desired width
                height as long,_ 'desired height
                _LR_LOADFROMFILE as long,_ 'load flag
                ' 'this is wrong
                ' 'fileName$ as Ulong 'handle of loaded image
                fhandle as Ulong ' handle of loaded image

                ' this is wrong
                ' loadbmp "f", fileName$ 'get the LB loadbmp name
                loadbmp "f",fhandle
                print #gwin.gbox, "down"
                print #gwin.gbox, "drawbmp f 0 0"
                WindowWidth = 400
                WindowHeight = 400
                UpperLeftX=INT((DisplayWidth-WindowWidth)/2)
                UpperLeftY=INT((DisplayHeight-WindowHeight)/2)
                open "Properties" for text as #prop
                print #prop, "!trapclose [quit1]"

                ' not needed you know it as fhandle
                hBitmap = hbmp("f")
                ' create a struct to old the retrieved info
                STRUCT BITMAP,_
                bmType as long,_
                bmWidth as long,_
                bmHeight as long,_
                bmWidthBytes as long,_
                bmPlanes as word,_
                bmBitsPixel as word,_
                bmBits as long

                nSize = len(BITMAP.struct) ' returns the length of the struct
                calldll #gdi32, "GetObjectA",_
                hBitmap as long,_ ' handle of object queried
                nSize as long,_ ' number of bytes in struct
                BITMAP as struct,_ ' address of struct
                result as long ' retrieves the number of bytes retreived, 0 on error

                type = BITMAP.bmType.struct
                width = BITMAP.bmWidth.struct
                height = BITMAP.bmHeight.struct
                widthBytes = BITMAP.bmWidthBytes.struct
                planes = BITMAP.bmPlanes.struct
                bpp = bmBitsPixel and bmBits' always return 0
                print #prop, "After API call"
                print #prop, "type of bitmap = ";type
                print #prop, "width of bitmap = ";width
                print #prop, "height of bitmap = ";height
                print #prop, "widthbytes = ";widthBytes
                print #prop, "The = ";bpp

                calldll #gdi32, "StretchBlt",_
                hDC as ulong,_ ' the destination dc
                0 as long,_ ' x location of destination
                0 as long,_ ' y location of destination ***********************
                400 as long,_ ' new width desired
                400 as long,_ ' new height desired
                hDCsource as ulong,_ ' the source dc
                0 as long,_ ' x location of source rectangle
                0 as long,_ 'y locaton of source rectangle
                ' these wre wrong you had missed as long
                width as long,_ ' width of source rectangle
                height as long,_ ' height of source rectangle
                _SRCCOPY as ulong,_' desired call
                result as long

                wait

                [quit1]
                unloadbmp "f"
                calldll #user32, "ReleaseDC",_
                h as ulong,_
                ' hDC?
                hdc as ulong
                close #prop
                ' close #gwin
                'end
                wait

                [whatabout]
                notice "BMP test"
                wait
                [exit]
                [quit]
                unloadbmp "f"
                close #gwin
                end
                ' code end




                [Non-text portions of this message have been removed]
              • Marc Rossi
                Dear Group, I couldn t get this line to compile when I used the commas and underscore but if I use it like this: calldll #gdi32, StretchBlt ,0 as long,0 as
                Message 7 of 9 , May 5, 2013
                • 0 Attachment
                  Dear Group,
                  I couldn't get this line to compile when I used the commas and underscore but if I use it like this:
                  calldll #gdi32, "StretchBlt",0 as long,0 as long,400 as long,400 as long,hDCsource as ulong,0 as long,0 as long,width as long,height as long,_SRCCOPY as ulong,result as Boolean
                  in a straight line it compile.  Any help on this matter would be appreciated.
                  Thanks,
                  Marc

                  ________________________________
                  From: Rod <rodbird@...>
                  To: libertybasic@yahoogroups.com
                  Sent: Sunday, May 5, 2013 4:52 AM
                  Subject: [libertybasic] Re: api call


                   

                  Well quite a lot wrong really but that's what basic is all about. You were loading the image as 400x400 I don't think you wanted to do that but perhaps I am not understanding what you are doing. I have commented the errors I see.

                  NOMAINWIN
                  WindowWidth = 700
                  WindowHeight = 700
                  UpperLeftX = (DisplayWidth - WindowWidth )/ 2
                  UpperLeftY = (DisplayHeight - WindowHeight )/ 2
                  width = 400
                  height = 400
                  Menu #gwin,"&Program", "&About", [whatabout]
                  Menu #gwin, "&Open file", "open", [op]
                  Menu #gwin, "&Exit", "&Quit", [quit]
                  graphicbox #gwin.gbox, 100, 40, 500, 550
                  open "Test BMP" for window as #gwin
                  print #gwin.gbox, "trapclose [quit]"
                  print #gwin.gbox, "home;fill black"
                  wait

                  [op]
                  filedialog "Open graphics file", "*.bmp", fileName$
                  'why are we doing this? fileName$
                  fil$ = fileName$
                  calldll #user32, "LoadImageA",_
                  0 as ulong,_ 'instance - use 0 for image from file
                  fileName$ as ptr,_ 'path and filename of image
                  _IMAGE_BITMAP as long,_ 'type of image

                  ' this may be wrong as you force your image to 400x400
                  ' use 0,0 if you want the natural width and height
                  width as long,_ 'desired width
                  height as long,_ 'desired height
                  _LR_LOADFROMFILE as long,_ 'load flag
                  ' 'this is wrong
                  ' 'fileName$ as Ulong 'handle of loaded image
                  fhandle as Ulong ' handle of loaded image

                  ' this is wrong
                  ' loadbmp "f", fileName$ 'get the LB loadbmp name
                  loadbmp "f",fhandle
                  print #gwin.gbox, "down"
                  print #gwin.gbox, "drawbmp f 0 0"
                  WindowWidth = 400
                  WindowHeight = 400
                  UpperLeftX=INT((DisplayWidth-WindowWidth)/2)
                  UpperLeftY=INT((DisplayHeight-WindowHeight)/2)
                  open "Properties" for text as #prop
                  print #prop, "!trapclose [quit1]"

                  ' not needed you know it as fhandle
                  hBitmap = hbmp("f")
                  ' create a struct to old the retrieved info
                  STRUCT BITMAP,_
                  bmType as long,_
                  bmWidth as long,_
                  bmHeight as long,_
                  bmWidthBytes as long,_
                  bmPlanes as word,_
                  bmBitsPixel as word,_
                  bmBits as long

                  nSize = len(BITMAP.struct) ' returns the length of the struct
                  calldll #gdi32, "GetObjectA",_
                  hBitmap as long,_ ' handle of object queried
                  nSize as long,_ ' number of bytes in struct
                  BITMAP as struct,_ ' address of struct
                  result as long ' retrieves the number of bytes retreived, 0 on error

                  type = BITMAP.bmType.struct
                  width = BITMAP.bmWidth.struct
                  height = BITMAP.bmHeight.struct
                  widthBytes = BITMAP.bmWidthBytes.struct
                  planes = BITMAP.bmPlanes.struct
                  bpp = bmBitsPixel and bmBits' always return 0
                  print #prop, "After API call"
                  print #prop, "type of bitmap = ";type
                  print #prop, "width of bitmap = ";width
                  print #prop, "height of bitmap = ";height
                  print #prop, "widthbytes = ";widthBytes
                  print #prop, "The = ";bpp

                  calldll #gdi32, "StretchBlt",_
                  hDC as ulong,_ ' the destination dc
                  0 as long,_ ' x location of destination
                  0 as long,_ ' y location of destination ***********************
                  400 as long,_ ' new width desired
                  400 as long,_ ' new height desired
                  hDCsource as ulong,_ ' the source dc
                  0 as long,_ ' x location of source rectangle
                  0 as long,_ 'y locaton of source rectangle
                  ' these wre wrong you had missed as long
                  width as long,_ ' width of source rectangle
                  height as long,_ ' height of source rectangle
                  _SRCCOPY as ulong,_' desired call
                  result as long

                  wait

                  [quit1]
                  unloadbmp "f"
                  calldll #user32, "ReleaseDC",_
                  h as ulong,_
                  ' hDC?
                  hdc as ulong
                  close #prop
                  ' close #gwin
                  'end
                  wait

                  [whatabout]
                  notice "BMP test"
                  wait
                  [exit]
                  [quit]
                  unloadbmp "f"
                  close #gwin
                  end
                  ' code end




                  [Non-text portions of this message have been removed]
                • Marc Rossi
                  Sorry.  There is no bug.  I had the syntax wrong.   My apologies, Marc ________________________________ From: Marc Rossi To:
                  Message 8 of 9 , May 5, 2013
                  • 0 Attachment
                    Sorry.  There is no bug.  I had the syntax wrong. 
                     My apologies,
                    Marc


                    ________________________________
                    From: Marc Rossi <mrossi8888@...>
                    To: "libertybasic@yahoogroups.com" <libertybasic@yahoogroups.com>
                    Sent: Sunday, May 5, 2013 11:35 PM
                    Subject: Re: [libertybasic] Re: api call bug in LB


                     

                    Dear Group,
                    I couldn't get this line to compile when I used the commas and underscore but if I use it like this:
                    calldll #gdi32, "StretchBlt",0 as long,0 as long,400 as long,400 as long,hDCsource as ulong,0 as long,0 as long,width as long,height as long,_SRCCOPY as ulong,result as Boolean
                    in a straight line it compile.  Any help on this matter would be appreciated.
                    Thanks,
                    Marc

                    ________________________________
                    From: Rod <mailto:rodbird%40hotmail.com>
                    To: mailto:libertybasic%40yahoogroups.com
                    Sent: Sunday, May 5, 2013 4:52 AM
                    Subject: [libertybasic] Re: api call


                     

                    Well quite a lot wrong really but that's what basic is all about. You were loading the image as 400x400 I don't think you wanted to do that but perhaps I am not understanding what you are doing. I have commented the errors I see.

                    NOMAINWIN
                    WindowWidth = 700
                    WindowHeight = 700
                    UpperLeftX = (DisplayWidth - WindowWidth )/ 2
                    UpperLeftY = (DisplayHeight - WindowHeight )/ 2
                    width = 400
                    height = 400
                    Menu #gwin,"&Program", "&About", [whatabout]
                    Menu #gwin, "&Open file", "open", [op]
                    Menu #gwin, "&Exit", "&Quit", [quit]
                    graphicbox #gwin.gbox, 100, 40, 500, 550
                    open "Test BMP" for window as #gwin
                    print #gwin.gbox, "trapclose [quit]"
                    print #gwin.gbox, "home;fill black"
                    wait

                    [op]
                    filedialog "Open graphics file", "*.bmp", fileName$
                    'why are we doing this? fileName$
                    fil$ = fileName$
                    calldll #user32, "LoadImageA",_
                    0 as ulong,_ 'instance - use 0 for image from file
                    fileName$ as ptr,_ 'path and filename of image
                    _IMAGE_BITMAP as long,_ 'type of image

                    ' this may be wrong as you force your image to 400x400
                    ' use 0,0 if you want the natural width and height
                    width as long,_ 'desired width
                    height as long,_ 'desired height
                    _LR_LOADFROMFILE as long,_ 'load flag
                    ' 'this is wrong
                    ' 'fileName$ as Ulong 'handle of loaded image
                    fhandle as Ulong ' handle of loaded image

                    ' this is wrong
                    ' loadbmp "f", fileName$ 'get the LB loadbmp name
                    loadbmp "f",fhandle
                    print #gwin.gbox, "down"
                    print #gwin.gbox, "drawbmp f 0 0"
                    WindowWidth = 400
                    WindowHeight = 400
                    UpperLeftX=INT((DisplayWidth-WindowWidth)/2)
                    UpperLeftY=INT((DisplayHeight-WindowHeight)/2)
                    open "Properties" for text as #prop
                    print #prop, "!trapclose [quit1]"

                    ' not needed you know it as fhandle
                    hBitmap = hbmp("f")
                    ' create a struct to old the retrieved info
                    STRUCT BITMAP,_
                    bmType as long,_
                    bmWidth as long,_
                    bmHeight as long,_
                    bmWidthBytes as long,_
                    bmPlanes as word,_
                    bmBitsPixel as word,_
                    bmBits as long

                    nSize = len(BITMAP.struct) ' returns the length of the struct
                    calldll #gdi32, "GetObjectA",_
                    hBitmap as long,_ ' handle of object queried
                    nSize as long,_ ' number of bytes in struct
                    BITMAP as struct,_ ' address of struct
                    result as long ' retrieves the number of bytes retreived, 0 on error

                    type = BITMAP.bmType.struct
                    width = BITMAP.bmWidth.struct
                    height = BITMAP.bmHeight.struct
                    widthBytes = BITMAP.bmWidthBytes.struct
                    planes = BITMAP.bmPlanes.struct
                    bpp = bmBitsPixel and bmBits' always return 0
                    print #prop, "After API call"
                    print #prop, "type of bitmap = ";type
                    print #prop, "width of bitmap = ";width
                    print #prop, "height of bitmap = ";height
                    print #prop, "widthbytes = ";widthBytes
                    print #prop, "The = ";bpp

                    calldll #gdi32, "StretchBlt",_
                    hDC as ulong,_ ' the destination dc
                    0 as long,_ ' x location of destination
                    0 as long,_ ' y location of destination ***********************
                    400 as long,_ ' new width desired
                    400 as long,_ ' new height desired
                    hDCsource as ulong,_ ' the source dc
                    0 as long,_ ' x location of source rectangle
                    0 as long,_ 'y locaton of source rectangle
                    ' these wre wrong you had missed as long
                    width as long,_ ' width of source rectangle
                    height as long,_ ' height of source rectangle
                    _SRCCOPY as ulong,_' desired call
                    result as long

                    wait

                    [quit1]
                    unloadbmp "f"
                    calldll #user32, "ReleaseDC",_
                    h as ulong,_
                    ' hDC?
                    hdc as ulong
                    close #prop
                    ' close #gwin
                    'end
                    wait

                    [whatabout]
                    notice "BMP test"
                    wait
                    [exit]
                    [quit]
                    unloadbmp "f"
                    close #gwin
                    end
                    ' code end

                    [Non-text portions of this message have been removed]




                    [Non-text portions of this message have been removed]
                  Your message has been successfully submitted and would be delivered to recipients shortly.