exporting part of a card
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 34
- Joined: Mon May 08, 2006 7:02 pm
exporting part of a card
Is it possible to export a "group" from a card as a PNG (or jpg) file? I have no trouble exporting any individual image files, but I need to be able to export a group (or some other method of exporting a specific area of a card that has multiple overlapping image files as one image).
Thanks for any help.
Thanks for any help.
-
- Posts: 34
- Joined: Mon May 08, 2006 7:02 pm
Thanks for the quick response. I have tried using the snapshot method, too, just as you have suggested, but all that shows up in the exported file is the rearmost image of the group. The other overlapping images do not appear. What happens to the rest of the group? Why only the rearmost image? Is there something else I might try?
Thanks again for any help and suggestions.
Scott
Thanks again for any help and suggestions.
Scott
Hi Scott,
Perhaps it should be something like:
export snapshot from rect (the rect of grp "myGroup") of cd "Your Card" to file "path/to/file" as png
Best,
Mark
Perhaps it should be something like:
export snapshot from rect (the rect of grp "myGroup") of cd "Your Card" to file "path/to/file" as png
Best,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
-
- Posts: 34
- Joined: Mon May 08, 2006 7:02 pm
Thanks again for the quick replies, guys. Unfortunately, the approach of referring back to the card didn't work, either. If this little app was only for Mac OSX it would be so easy just to "print" the group and save as a PDF file, but I can't use that approach for Windows since that saves as XPS.
What I am trying to accomplish is to have the user build their own image for export to be used in PowerPoint (Mac or Windows) and/or Keynote (Mac), etc. They would build the image by "turning on" or "turning off" selectable items on the card.
The group prints as it should for handouts, but I still need some way to export it.
Sorry for the long post, but maybe it will help clarify what I am doing.
Thanks again.
Scott
What I am trying to accomplish is to have the user build their own image for export to be used in PowerPoint (Mac or Windows) and/or Keynote (Mac), etc. They would build the image by "turning on" or "turning off" selectable items on the card.
The group prints as it should for handouts, but I still need some way to export it.
Sorry for the long post, but maybe it will help clarify what I am doing.
Thanks again.
Scott
-
- VIP Livecode Opensource Backer
- Posts: 10049
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
In v2.7 the "export snapshot" command was enhanced to allow you to specify an object rather than just a rect:
export snapshot from grp "MyGroup" to file "MyImage.jpg" as jpeg
This will cause the object specified to be rendered into an offscreen buffer directly, then that buffer is compressed into the specified format for writing to disk.
This differs from the other forms of "export snapshot" in that the others merely grab a portion of the card that's already rendered, which may contain other overlapping elements.
export snapshot from grp "MyGroup" to file "MyImage.jpg" as jpeg
This will cause the object specified to be rendered into an offscreen buffer directly, then that buffer is compressed into the specified format for writing to disk.
This differs from the other forms of "export snapshot" in that the others merely grab a portion of the card that's already rendered, which may contain other overlapping elements.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
-
- Posts: 34
- Joined: Mon May 08, 2006 7:02 pm
I want to thank all of you guys. I really appreciate the forums.
I had actually tried all of these approaches, but the group still wouldn't render correctly. The problem seems to be solved — I don't know why exactly, though. Just on a whim, I decided to rename the group and try again. So I went back into the script and made sure I changed it there, too. It now works flawlessly. There were no misspellings or anything before (I even checked again before I made changes), so I am not sure what changing the name of the group had to do with anything (all I did was add two letters).
I am at a loss as to why it works now, but it does and that is fine with me.
Thanks again guys for the help and suggestions.
Scott
I had actually tried all of these approaches, but the group still wouldn't render correctly. The problem seems to be solved — I don't know why exactly, though. Just on a whim, I decided to rename the group and try again. So I went back into the script and made sure I changed it there, too. It now works flawlessly. There were no misspellings or anything before (I even checked again before I made changes), so I am not sure what changing the name of the group had to do with anything (all I did was add two letters).
I am at a loss as to why it works now, but it does and that is fine with me.
Thanks again guys for the help and suggestions.
Scott