Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Image control doesn't return the proper dimensions
Message
 
 
À
07/11/2002 23:56:53
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00720146
Message ID:
00720174
Vues:
13
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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform