Save Card Window as Graphic

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
trailboss
Posts: 121
Joined: Sat Dec 13, 2008 4:55 pm

Save Card Window as Graphic

Post by trailboss » Mon Apr 08, 2013 11:16 pm

I'm putting this into the basic area because I've looked through the forum and can't get something basic to work.

I simply want to save a RunRev PAGE/CARD as a graphic.
I have used snapshot to do some other things, but I'm spending forever getting this simple thing done.

FROM DOCUMENTATION:
local tSnapshot
revBrowserSnapshot sBrowserId, "tSnapshot"
set the imageData of image "Browser Thumbnail" to tSnapshot

It doesn't work for me no how and no way I cook it.

I've tried lots of other ways too.

I guess I don't know what I'm doing. What is a simple way to make a snapshot of the card so I can save it as a jpg, png, gif, maybe even pdf?

Thanks for any help,
Tom

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am
Location: Palo Alto

Re: Save Card Window as Graphic

Post by Simon » Mon Apr 08, 2013 11:32 pm

Hi Tom,
Just checking but is your request specifically for the browser object or any card/object?
Yes, I can see you wrote "revBrowserSnapshot" but I thought I'd ask to be sure.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

trailboss
Posts: 121
Joined: Sat Dec 13, 2008 4:55 pm

Re: Save Card Window as Graphic

Post by trailboss » Mon Apr 08, 2013 11:48 pm

I just want to save the card screen as a graphic. Like a screenshot of what's on the card without the menu or anything.

(The documentation read: "The revBrowserSnapshot command takes a snapshot of the page currently being displayed in the specified browser object.") So I tried it.

I tried other ways than the above, but it should be rather simple. I'm just not getting lucky with this.
Or I would be happy to know how to snapshot a particular area of the screen -- like ALL of it. I have indeed been able to do that with a specified part of a field (but not the card itself). Like this:
import snapshot from rectangle 0,0,228,198 of field "mydata" of this card

But again, I just want to save the card as a graphic.

Tom

sturgis
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1685
Joined: Sat Feb 28, 2009 11:49 pm

Re: Save Card Window as Graphic

Post by sturgis » Mon Apr 08, 2013 11:51 pm

try
import snapshot from card "cardname" hopefully that will give you the results you want.

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am
Location: Palo Alto

Re: Save Card Window as Graphic

Post by Simon » Mon Apr 08, 2013 11:58 pm

here as well:

Code: Select all

on mouseUp
   set the defaultFolder to specialFolderPath("desktop")
   export snapshot from this cd to file "snap.jpg" as JPEG
end mouseUp
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

sturgis
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1685
Joined: Sat Feb 28, 2009 11:49 pm

Re: Save Card Window as Graphic

Post by sturgis » Tue Apr 09, 2013 12:04 am

oh do. Yep export to9 a file. Import if you just want it as part of the stack. Me and reading haven't been on friendly terms lately.

trailboss
Posts: 121
Joined: Sat Dec 13, 2008 4:55 pm

Re: Save Card Window as Graphic

Post by trailboss » Tue Apr 09, 2013 12:40 am

This works perfectly and is as simple as I thought it was. Thanks so very much.

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am
Location: Palo Alto

Re: Save Card Window as Graphic

Post by Simon » Tue Apr 09, 2013 12:44 am

Glad it worked. :D
My first reply was for specifically addressing a revBrowserSnapshot question.
revBrowserSnapshot is specific to a browser in LC (like an IE or Safari browser(Browser Sampler.rev)) to take a snapshot of the web page. "export snapshot" Doesn't work on a browser object.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

trailboss
Posts: 121
Joined: Sat Dec 13, 2008 4:55 pm

Re: Save Card Window as Graphic

Post by trailboss » Tue Apr 09, 2013 12:55 am

I see. Well, one day I will compile a "toolbox" of fun buttons that do any easy thing. Simple scripts like the one you gave me instead of the kind of hard to understand stuff in some of the documentation.

Tom

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”