Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to GetBitmapDimensionEx?
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00438099
Message ID:
00438104
Views:
15
>BOOL GetBitmapDimensionEX(hBitmap, lpDimension)
>My feeble attempts at this returned entry point errors. Any help appreciated. I am trying to get the pixel width and height of a BMP file.

Using CLSHeap:
SET PROC TO CLSHEAP ADDITIVE
DECLARE SHORT GetBitmapDimensionEx IN GDI32 ;
  INTEGER hBitMap, ;
  STRING @ lpDIMENSION
DECLARE INTEGER GetLastError IN Win32API
cDimensionStruc = REPL(CHR(0),8)
IF GetBitmapDimensionEx(nhBitMap, @cDimensionStruc) # 0
   nXSize = DWORDToNum(LEFT(cDimensionStruc,4))
   nYSize = DWORDToNum(RIGHT(cDimensionStruc,4))
ELSE
   ? 'Error: ' + TRANSFORM(GetLastError())
ENDIF
You'd have gotten nhBitmap as a return value from calling LoadImage() or some other function/object would need to provide it. LoadImage would look something like:

DECLARE INTEGER LoadImage IN GDI32 ;
INTEGER hInstance, ;
STRING @ lpszName, ;
INTEGER uType, ;
INTEGER cXDesired, ;
INTEGER cYDesired, ;
INTEGER fuLoad
nhBitMap = LoadImage(0,name of bitmap file,0,0,0,0x50)

but could vary considerably from this
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform