Fun with the templateimage

Klaus major-k klaus at major-k.de
Wed Oct 30 16:13:42 EDT 2019


Hi all,

we know that "the templatexxxxxx" is a very helpful thingie.

But I was really surprised that we can even EXPORT something
from the templateimage until I tried this:
-------------------------------------------------
on mouseUp

  ## My good ol' banana, older users of MC might remember that one :-D
  set the filename of the templateimage to "/Users/klaus2/Desktop/BANANA.jpg"

  ## This was a know (to me) feature
  put the formattedwidth of the templateimage into tFW
  put the formattedheight of the templateimage into tFH
  ## Now you can apply some "rule of three" to scale the image while preserving its ratio
  ## I'll leave that up to you... :-)

  ## I cheated a bit:
  set the width of the templateimage to 181
  set the height of the templateimage to 252

  ## But this one really suprised me:
  export the templateimage to file (specialfolderpath("desktop") & "/eltesto.jpg") as JPEG
  reset the templateimage
end mouseUp
-----------------------------------------------------
No image object involved, how cool is that?! :-)


Best

Klaus

--
Klaus Major
https://www.major-k.de
klaus at major-k.de





More information about the use-livecode mailing list