import snapshot gives empty image

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
AppleBite
Posts: 7
Joined: Fri Oct 31, 2014 10:25 am

import snapshot gives empty image

Post by AppleBite » Tue Feb 28, 2017 10:18 am

Hi at all,

i tried to let the user create a screenshot by using the command "import snapshot" without any parameters, that the user could define the rectangle by himself.

on mouseUp
import snapshot
end mouseUp

The result is an empty image. Using "import snapshot" with parameters like

on mouseUp
import snapshot from rectangle 0,0,800,600
end mouseUp

works fine.

Any idea?

Thanks for help

AppleBite

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: import snapshot gives empty image

Post by jmburnod » Tue Feb 28, 2017 10:27 am

Hi ,
You can use a group which contains one grc rectangle (blendlevel to 50), one resize box and some scripts to resize and move it and use rect as param for import snapshot.
You may have a look to "sample stacks" item of menu " help" and search "ResizeGroup" to find a Bernd's stack for you :D
Best regards
Jean-Marc
https://alternatic.ch

AppleBite
Posts: 7
Joined: Fri Oct 31, 2014 10:25 am

Re: import snapshot gives empty image

Post by AppleBite » Tue Feb 28, 2017 10:42 am

Hi,

but why do in have to program the resize functionality. "import snapshot" gives everything and creates a image. The only thing is, that it's empty :-(

Regards

AppleBite

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: import snapshot gives empty image

Post by jmburnod » Tue Feb 28, 2017 11:12 am

If you do:

Code: Select all

Import snapshot from this cd
and you get an image of current cd
Jean-Marc
https://alternatic.ch

AppleBite
Posts: 7
Joined: Fri Oct 31, 2014 10:25 am

Re: import snapshot gives empty image

Post by AppleBite » Tue Feb 28, 2017 11:20 am

Hi Jean-Marc,

sorry, but this is not what i want. I would like to use the command "import snapshot" in the way it's explained in the your dictionary:

"If you do not specify a rectangle or an object, LiveCode displays a crosshairs cursor. Click at one corner of the rectangle to be imported and drag to the opposite corner to select the area."

As i wrote, it gives an empty image.

Regards

AppleBite

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: import snapshot gives empty image

Post by jmburnod » Tue Feb 28, 2017 12:08 pm

I did exactly what you describe in LC indy 7.0.6 and 8.1.3 and it works for me
What version do you use ?
Best
Jean-Marc
https://alternatic.ch

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

Re: import snapshot gives empty image

Post by Klaus » Tue Feb 28, 2017 12:13 pm

Hi AppleBite,

just made a quick test on macOS 10.12.3 with LC 9 dp5 and LC 8.1.3 stable and it worked as advertised!
One stack with one button:

Code: Select all

on mouseup
   import snapshot
end mouseup
I clicked the button, got a CROSSHAIR cursor, dragged and ended with a snapshot of
the "dragged" area on my card.

What platform are you on and what version of LC are you using?


Best

Klaus

AppleBite
Posts: 7
Joined: Fri Oct 31, 2014 10:25 am

Re: import snapshot gives empty image

Post by AppleBite » Tue Feb 28, 2017 1:22 pm

Hi,

i tested the situation with LIvecode 8.1.3 Build 14017 and Livecode 9.0.0 (just downloaded).

Operation System is: OS X El Capitan 10.11.6 (15G1217)

And the Application is as you described: New Stack, New Button and the simple code.

Have no idea, why it's not working here. :cry:

Thanks for help

AppleBite

P.S. One thing: I'm working with two monitors. Switch one off. Same result.

AppleBite
Posts: 7
Joined: Fri Oct 31, 2014 10:25 am

Re: import snapshot gives empty image

Post by AppleBite » Tue Feb 28, 2017 1:41 pm

Hi,

Next Steps:

I created a standalone windows application. And it's working. :-)
I created a standalone OS X application. It's not working on the development computer ....

Seems strange to me.

AppleBite

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

Re: import snapshot gives empty image

Post by Klaus » Tue Feb 28, 2017 6:17 pm

Hm, really strange, indeed! :shock:
Sorry, no brilliant idea in the moment...

Post Reply