export snapshot

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
MaxV
Posts: 1580
Joined: Tue May 28, 2013 2:20 pm
Contact:

export snapshot

Post by MaxV » Wed Feb 01, 2017 5:29 pm

What is the correct syntax of:

Code: Select all

export snapshot from rect  tRect of this stack to file myFile AS JPEG
??
I wan to use a rect with relative to stack coordinates, not to screen coordinates.
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

Klaus
Posts: 14198
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: export snapshot

Post by Klaus » Wed Feb 01, 2017 5:35 pm

Hi Max,

use "of this cd":
...
export snapshot from rect tRect of this cd to file (specialfolderpath("desktop") & "/test.jpg") AS JPEG
...
Tested and works! :D


Best

Klaus

MaxV
Posts: 1580
Joined: Tue May 28, 2013 2:20 pm
Contact:

Re: export snapshot

Post by MaxV » Wed Feb 01, 2017 5:42 pm

Thank Klaus, but I just discovered that my problem was elsewhere.
If I have an image, I change the file where the filename points to, I change the filename again to redfreh it... livecode doesn't do anything because the previous name and the current name are the same and so I doesn't refresh the image. :shock:
This is my workaround:

Code: Select all

   repeat for each item tItem in lista      
      export snapshot from  rect ( the rect of image titem ) of this card  to file tItem AS JPEG
      set the filename of image tItem to  empty  #!!!!!!! needed!!!!
      set the filename of image tItem to  tItem
   end repeat   
I was going crazy!!!
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

Post Reply