Page 1 of 1

import snapshot gives empty image

Posted: Tue Feb 28, 2017 10:18 am
by AppleBite
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

Re: import snapshot gives empty image

Posted: Tue Feb 28, 2017 10:27 am
by jmburnod
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

Re: import snapshot gives empty image

Posted: Tue Feb 28, 2017 10:42 am
by AppleBite
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

Re: import snapshot gives empty image

Posted: Tue Feb 28, 2017 11:12 am
by jmburnod
If you do:

Code: Select all

Import snapshot from this cd
and you get an image of current cd
Jean-Marc

Re: import snapshot gives empty image

Posted: Tue Feb 28, 2017 11:20 am
by AppleBite
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

Re: import snapshot gives empty image

Posted: Tue Feb 28, 2017 12:08 pm
by jmburnod
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

Re: import snapshot gives empty image

Posted: Tue Feb 28, 2017 12:13 pm
by Klaus
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

Re: import snapshot gives empty image

Posted: Tue Feb 28, 2017 1:22 pm
by AppleBite
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.

Re: import snapshot gives empty image

Posted: Tue Feb 28, 2017 1:41 pm
by AppleBite
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

Re: import snapshot gives empty image

Posted: Tue Feb 28, 2017 6:17 pm
by Klaus
Hm, really strange, indeed! :shock:
Sorry, no brilliant idea in the moment...