Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Image control doesn't return the proper dimensions
Message
From
08/11/2002 04:48:39
 
 
To
07/11/2002 23:56:53
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00720146
Message ID:
00720174
Views:
12
This message has been marked as the solution to the initial question of the thread.
Hi!

I'm not sure, but something like following works (with use of LoadPicture):
GetDimension(lcFile+'.jpg', @lnWidth, @lnHeight)

procedure GetDimension
PARAMETER tcFile, tcWidth, tcHeight
loImage=LoadPicture(m.tcFile)
tcWidth = round(loImage.width/26.458)
tcHeight = round(loImage.height/26.458)
HTH.

>For some isolated cases, the image control doesn't return the proper dimensions. This is the function that I am using:
>
>
>loImage=GetDimension(lcFile+'.jpg')
>lnWidth=loImage.Width
>lnHeight=loImage.Height
>
>* Return an object to get the image dimensions
>* expC1 Full path of the file
>FUNCTION GetDimension
>PARAMETER tcFile
>loImage=CREATEOBJECT('Image')
>loImage.Picture=tcFile
>RETURN loImage
>
>
>Usually, this is working fine. But, I have found that sometimes, it returns some coordinates which are way bigger than the actual image size. Anyone found a way to make that bullet proof?
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform