Visuals, audio, animation. Blended, not stirred. If LiveCode is part of your rich media production toolbox, this is the forum for you.
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
shaosean
- Posts: 906
- Joined: Thu Nov 04, 2010 7:53 am
Post
by shaosean » Tue Nov 23, 2010 1:53 am
Am taking a snapshot of an image control (actually any control shows the issue) but the returned image data seems to be broken.. If I export to a file, the file has the correct data.. Am using Rev Enterprise 4.0 on Mac OS X 10.5.8 (PPC), I tried with Rev 2.8.1 and got the same issue..
- create a new stack
- import an image on the card
- place a button on the card
- edit the script of the button (use the code below)
- click button
Code: Select all
on mouseUp
constant kObj = "image 1"
local tSs
export snapshot from kObj to tSs
create image
set the width of it to (the width of kObj)
set the height of it to (the height of kObj)
set the imageData of it to tSs
end mouseUp
-
shaosean
- Posts: 906
- Joined: Thu Nov 04, 2010 7:53 am
Post
by shaosean » Tue Nov 23, 2010 2:00 am
Apparently one does not simply set the imageData of an image, but the text..
works
-
Klaus
- Posts: 14191
- Joined: Sat Apr 08, 2006 8:41 am
-
Contact:
Post
by Klaus » Tue Nov 23, 2010 1:39 pm
Hi Sean,
yep, that's right.
Although setting the text of an image is everything but intuitive and mentally highly challenging
Best
Klaus
-
shaosean
- Posts: 906
- Joined: Thu Nov 04, 2010 7:53 am
Post
by shaosean » Tue Nov 23, 2010 2:15 pm
No wonder I stay away from doing GUI related features

-
jmburnod
- VIP Livecode Opensource Backer

- Posts: 2729
- Joined: Sat Dec 22, 2007 5:35 pm
-
Contact:
Post
by jmburnod » Wed Nov 24, 2010 9:40 pm
Hi All
Why not
Code: Select all
export snapshot from kObj to file MyFilePath
set the filename of last img to MyFilePath
Best
Jean-Marc
https://alternatic.ch
-
shaosean
- Posts: 906
- Joined: Thu Nov 04, 2010 7:53 am
Post
by shaosean » Wed Nov 24, 2010 10:42 pm
Thanks for the tip, but trying to figure out where to store temporary files on someone else's machine is not always a nice thing to do so I was looking to do it all in memory
-
paul_gr
- Posts: 319
- Joined: Fri Dec 08, 2006 7:38 pm
Post
by paul_gr » Wed Nov 24, 2010 11:15 pm
Klaus wrote:setting the text of an image is everything but intuitive and mentally highly challenging.
You got that right...
Paul
-
Klaus
- Posts: 14191
- Joined: Sat Apr 08, 2006 8:41 am
-
Contact:
Post
by Klaus » Thu Nov 25, 2010 12:29 am
shaosean wrote:Thanks for the tip, but trying to figure out where to store temporary files on someone else's machine is not always a nice thing to do so I was looking to do it all in memory
Hm, isn't the TEMP folder(specialfolderpath("temporary")) meant for these kind of actions?
I always used this in the past and never got sued!

-
shaosean
- Posts: 906
- Joined: Thu Nov 04, 2010 7:53 am
Post
by shaosean » Thu Nov 25, 2010 1:11 am
But there is no point to writing out a file when it can all be done in memory.. That makes the code quicker and also causes less wear on the drive

-
Klaus
- Posts: 14191
- Joined: Sat Apr 08, 2006 8:41 am
-
Contact:
Post
by Klaus » Thu Nov 25, 2010 1:09 pm
shaosean wrote:But there is no point to writing out a file when it can all be done in memory.. That makes the code quicker and also causes less wear on the drive

OK, OK, lets agree that this might be a case of personal taste
