Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sizing Question
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Photos et traitement d'images
Titre:
Divers
Thread ID:
00462691
Message ID:
00462785
Vues:
12
>I am going to add the ability to store a path to a picture for inventory records. I was thinking of building a form class to display the image. This way the end user would click a button to see the picture rather than wasting real estate on the main form.
>
>Anyway, I'm wondering the best way to handle different size images. I envision that different clients will be creating different sized images. Should I put a requirement on a size or is there a way to adjust the size of the form class to accomodate different size images?
>

There's a couple Win32 API calls that will determine the size of a bitmap:
DECLARE SHORT CloseHandle IN Win32API INTEGER
DECLARE INTEGER LoadImage IN USER32 ;
   INTEGER, ;
   STRING @, ;
   INTEGER, ;
   INTEGER, ;
   INTEGER, ;
   INTEGER
DECLARE INTEGER GetObject IN Win32API AS GetO1 INTEGER, INTEGER, STRING @
hBitMap = LoadImage( 0, GETPICT(), 0, 0, 0, 0x50)  && load a bitmap from file default size
tbitmap=repl(chr(0),24000)  && leaves lots of space for the bitmap
? GetO1(hBitMap,24000,@tbitmap) && read bitmap structure from object
SET PROC TO clsheap
? DWORDtoNum(subst(tbitmap,5)), DWORDtoNUM(subst(tbitmap,9)) && pull width, height
=CloseHandle(hBitMap)
Size is in pixels
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform