picture size

Klaus Major k_major at osnabrueck.netsurf.de
Sun May 5 08:02:01 EDT 2002


Hi Robert,

> Robert Brenstein wrote:
>
>> Is there a simple way to get the pixel sizes of images (jpeg and gif)
>> in Metacard? In HyperCard, I use the picture command to open them
>> invisibly (this is important), then fetch the size. The picture
>> command does not seem to be part of MetaCard.
>>
>> picture (fPath & fName),,,false
>> get pictureheight of window fName
>> get picturewidth of window fName
>> close window fName
>
> MetaCard's syntax is arguably more self-consistent with the priciples of
> HyperTalk on this one.  Rather than relying on an external MC has native
> image objects, with properties that can be querried and set like 
> buttons and
> fields.
>
> In this case, the property you're looking for is the fileName of the 
> image
> object:
>
>   set the filename of image 1 to tMyPath
>   get the rect of image 1
>
> If you don't already have an image object on the card, you can also 
> import
> image files into a new image object using the import command.
>
> --
>  Richard Gaskin

Richard is right, as always ;-)

But maybe these props could be of any more help to you.

the formattedheight of image "xxx"
the formattedwidth of image "xxx"

This will return the original height and width of an image.


Regards

Klaus Major
k_major at osnabrueck.netsurf.de




More information about the metacard mailing list