Skip to main content
guest
Join | Help | Sign In
Liberty BASIC Community Wiki Home
guest| Join | Help | Sign In
Liberty BASIC Community Wiki
  • Wiki Home
  • Recent Changes
  • Pages and Files
  • Members
  • Home
    • Liberty BASIC FAQ
    • Contests
    • Tutorials
    • Science
    • Shared Code
    • Tips
    • DLLs
    • PublicDomainSprites
    • Member Pages
    • Links
    • Sandbox

BitMap Dimensions

Edit 0 3 …
  • 0 Tags
    • No tags
  • Notify
  • RSS
  • Backlinks
  • Source
  • Print
  • Export (PDF)
Older Version Newer Version

Alyce Alyce Jan 7, 2006

 

Get Bitmap Dimensions

struct BITMAP,_
bmType as long,_
bmWidth As long,_
bmHeight As long,_
bmWidthBytes As long,_
bmPlanes as word,_
bmBitsPixel as word,_
bmBits as Long

filedialog "Open","*.bmp",bmp$
if bmp$="" then end
loadbmp "testbmp",bmp$
hTest=hbmp("testbmp")
print BitmapWidth(hTest)
print BitmapHeight(hTest)
unloadbmp "testbmp"
END

Function BitmapWidth(hBmp)
length=len(BITMAP.struct)
calldll #gdi32, "GetObjectA", hBmp as ulong,_
length as long,BITMAP as struct,_
results as long
BitmapWidth=BITMAP.bmWidth.struct
End Function

Function BitmapHeight(hBmp)
length=len(BITMAP.struct)
calldll #gdi32, "GetObjectA", hBmp as ulong,_
length as long,BITMAP as struct,_
results as long
BitmapHeight=BITMAP.bmHeight.struct
End Function



- Alyce Alyce Jan 7, 2006
Help · About · Pricing · Privacy · Terms · Support · Upgrade
Contributions to https://basic.wikispaces.com/ are licensed under a Creative Commons Attribution Share-Alike 2.5 License. Creative Commons Attribution Share-Alike 2.5 License
Portions not contributed by visitors are Copyright 2018 Tangient LLC
TES: The largest network of teachers in the world
Turn off "Getting Started"
  1. Home
  2. ...
Loading...