General information
Category:
Pictures and Image processing
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only