Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Query Image File Dimensions
Message
 
 
To
12/02/1999 22:28:36
General information
Forum:
Visual FoxPro
Category:
Pictures and Image processing
Miscellaneous
Thread ID:
00187314
Message ID:
00187468
Views:
15
o = loadpicture(Getpict())
?o.width
?o.height

Keep in mind, the units returned are in TWIPS. Twips are resolution dependent. in most cases, there are 15 Twips per pixel.

Here is a class that will convert twips to pixels and vice versa:

DEFINE CLASS cusscaleconvert AS custom


nfactorx = 0
nfactory = 0
Name = "cusscaleconvert"


PROCEDURE convert
LOCAL lihwnd,lihdc,lipixelsperinchx,lipixelsperinchy
* Define some constants.
#DEFINE cnlog_pixels_x 88
#DEFINE cnlog_pixels_y 90
#DEFINE cntwips_per_inch 1440

DECLARE integer GetActiveWindow in WIN32API
DECLARE integer GetDC in WIN32API integer iHDC
DECLARE integer GetDeviceCaps ;
in WIN32API integer iHDC, integer iIndex

lihwnd = getactivewindow()
lihdc = getdc(lihwnd)

lipixelsperinchx = getdevicecaps(lihdc, cnlog_pixels_x)
lipixelsperinchy = getdevicecaps(lihdc, cnlog_pixels_y)

WITH This
.nfactorx = cntwips_per_inch/lipixelsperinchx
.nfactory = cntwips_per_inch/lipixelsperinchy
ENDWITH

Return
ENDPROC



ENDDEFINE




>How can I query a jpg file and get it's dimensions?
>TIA
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform