angle and rotate commands

Ken Ray kray at sonsothunder.com
Mon Oct 14 14:20:00 EDT 2002


Rodney,

Make sure you set the "lockLocation" to true right after you change the
angle (and lockscreen too while you're at it). Also, you  mention "set the
filename of img "view" to theFile, but I think you meant "what" (the param
coming into previewMedia). Something like this:

on previewMedia what
  set the angle of img 1 to 90
  set the lockLocation of img 1 to true
  lock screen
  set the cursor to busy
  set the filename of img 1 to what
  put the height of img 1 into theH
  put the width of img 1 into theW
  #in this case I want to scale the images so they are never more than
  #300 pixels wide or high.  Images being displayed may be wide or tall -
  #check this image and scale appropriately.
  if (theW > theH) then
    put 300 * (theH / theW) into theRat
    set the width of img 1 to 300
    set the height of img 1 to theRat
  else
    put 300 * (theW / theH) into theRat
    set the height of img 1 to 300
    set the width of img 1 to theRat
  end if
  unlock screen
end previewMedia

Hope this helps,

Ken Ray
Sons of Thunder Software
Email: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/

----- Original Message -----
From: "Rodney Tamblyn" <rtamblyn at xtra.co.nz>
To: <metacard at lists.runrev.com>
Sent: Monday, October 14, 2002 12:20 PM
Subject: angle and rotate commands


> Hello everyone,
>
> I have just resubscribed to the Metacard list after taking a break
> for a few months.
>
> I've been experimenting with the angle and rotate commands with
> images.  It doesn't seem
> to be possible to scale an image and set it's angle as well.  Am I
> missing something obvious here?
>
> Here's the script:
>
> on previewMedia what
> ...
>    #let's say the images all need to be rotated 90 degrees
> set the angle of img "view" to 90
>    set the cursor to busy
>    set the filename of img "view" to theFile
>    put the height of img "view" into theH
>    put the width of img "view" into theW
> #in this case I want to scale the images so they are never more than
> #300 pixels wide or high.  Images being displayed may be wide or tall -
> #check this image and scale appropriately.
>    if (theW > theH) then
>      put 300 * (theH / theW) into theRat
>      set the width of img "view" to 300
>      set the height of img "view" to theRat
>    else
>      put 300 * (theW / theH) into theRat
>      set the height of img "view" to 300
>      set the width of img "view" to theRat
>    end if
> end previewMedia
>
>
> --
> Rodney Tamblyn
> 401 North 6th Ave,
> Pensacola FL 32501
> USA (850) 4357794
> _______________________________________________
> metacard mailing list
> metacard at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/metacard
>




More information about the metacard mailing list