Blank Snapshot in iOS
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- VIP Livecode Opensource Backer
- Posts: 114
- Joined: Fri Apr 28, 2006 12:10 am
- Location: Seattle
Blank Snapshot in iOS
Hi All,
I am using this code:
put item 1 of the screenmouseloc into x0
put item 2 of the screenmouseLoc into y0
import snapshot from rectangle (x0-50, y0-50, x0 +50, y0+50)
which works fine in the IDE but not the iOS environment. In iOS, I get a blank (or black?) image.
Can someone please help me with this?
Thanks,
Roger
I am using this code:
put item 1 of the screenmouseloc into x0
put item 2 of the screenmouseLoc into y0
import snapshot from rectangle (x0-50, y0-50, x0 +50, y0+50)
which works fine in the IDE but not the iOS environment. In iOS, I get a blank (or black?) image.
Can someone please help me with this?
Thanks,
Roger
-
- VIP Livecode Opensource Backer
- Posts: 296
- Joined: Wed May 02, 2012 12:23 pm
- Location: New York
- Contact:
Re: Blank Snapshot in iOS
Hi Roger,
I did a quick test and it works fine in the simulator.
I've put exactly your 3 line of code in a mouseUp handler in card script.
It seems that the problem you're facing is related to something else.
I suggest to look at the other parts of your code.
Best,
~ Ender Nafi
I did a quick test and it works fine in the simulator.
I've put exactly your 3 line of code in a mouseUp handler in card script.
It seems that the problem you're facing is related to something else.
I suggest to look at the other parts of your code.
Best,
~ Ender Nafi
~... together, we're smarter ...~
__________________________________________
macOS Sierra • LiveCode 7 & xCode 8
__________________________________________
macOS Sierra • LiveCode 7 & xCode 8
-
- Livecode Opensource Backer
- Posts: 328
- Joined: Mon Dec 05, 2011 5:34 pm
- Location: Thailand
- Contact:
Re: Blank Snapshot in iOS
Which version of LC are you using?
In LC6 on my iPad I had to do a "lock screen", just before doing a snapshot or else it would not work (ie blank image). The same code without the lock screen works fine from LC5.5.4. The only difference was the addition of the "lock screen" line before and the "unlock screen" after the snapshot call.
I think the same also applied to taking a photo and assigning it to another image - can't remember just now though.
Cheers,
Dave
In LC6 on my iPad I had to do a "lock screen", just before doing a snapshot or else it would not work (ie blank image). The same code without the lock screen works fine from LC5.5.4. The only difference was the addition of the "lock screen" line before and the "unlock screen" after the snapshot call.
I think the same also applied to taking a photo and assigning it to another image - can't remember just now though.
Cheers,
Dave
Coding in the Sun - So much Fun.
Visit http://electronic-apps.info for released App information.
Visit http://electronic-apps.info for released App information.
-
- VIP Livecode Opensource Backer
- Posts: 114
- Joined: Fri Apr 28, 2006 12:10 am
- Location: Seattle
Re: Blank Snapshot in iOS
Thank you, Ender, but that is not the case for me. I did exactly as you did and ended up with a blank again. What now?
Roger
Roger
endernafi wrote:Hi Roger,
I did a quick test and it works fine in the simulator.
I've put exactly your 3 line of code in a mouseUp handler in card script.
It seems that the problem you're facing is related to something else.
I suggest to look at the other parts of your code.
Best,
~ Ender Nafi
-
- VIP Livecode Opensource Backer
- Posts: 114
- Joined: Fri Apr 28, 2006 12:10 am
- Location: Seattle
Re: Blank Snapshot in iOS
Thanks, Dave. I'm using LC 5.5.4 and I am also using "lock Screen". Here is my entire code called from a mouseDown handler:
on ZoomThing
if the short name of the owner of the target is not "ControlsGrp" then
if exists(image ZoomShot) then delete image zoomShot
lock screen
put item 1 of the screenmouseloc into x0
put item 2 of the screenmouseLoc into y0
import snapshot from rectangle (x0-50, y0-50, x0 +50, y0+50) ---of window 180490432 (this does not work)
--set the width of last image to 2*the formattedWidth of last image
--set the height of last image to 2*the formattedHeight of last image
--set the loc of last image to the Mouseloc
set the name of last image to ZoomShot
unlock screen
end if
end ZoomThing
I commented out a few lines in an effort to isolate my problem, to no avail.
What the heck???
Roger
on ZoomThing
if the short name of the owner of the target is not "ControlsGrp" then
if exists(image ZoomShot) then delete image zoomShot
lock screen
put item 1 of the screenmouseloc into x0
put item 2 of the screenmouseLoc into y0
import snapshot from rectangle (x0-50, y0-50, x0 +50, y0+50) ---of window 180490432 (this does not work)
--set the width of last image to 2*the formattedWidth of last image
--set the height of last image to 2*the formattedHeight of last image
--set the loc of last image to the Mouseloc
set the name of last image to ZoomShot
unlock screen
end if
end ZoomThing
I commented out a few lines in an effort to isolate my problem, to no avail.
What the heck???
Roger
dave_probertGA6e24 wrote:Which version of LC are you using?
In LC6 on my iPad I had to do a "lock screen", just before doing a snapshot or else it would not work (ie blank image). The same code without the lock screen works fine from LC5.5.4. The only difference was the addition of the "lock screen" line before and the "unlock screen" after the snapshot call.
I think the same also applied to taking a photo and assigning it to another image - can't remember just now though.
Cheers,
Dave
-
- VIP Livecode Opensource Backer
- Posts: 296
- Joined: Wed May 02, 2012 12:23 pm
- Location: New York
- Contact:
Re: Blank Snapshot in iOS
Roger hi,
Could you hide the status bar from Standalone Application Settings and then give it a try please?
It seems that status bar causes the problem.
Edit:
I've attached a working sample which doesn't require hiding the status bar, hope it helps...
Best,
~ Ender Nafi
Could you hide the status bar from Standalone Application Settings and then give it a try please?
It seems that status bar causes the problem.
Edit:
I've attached a working sample which doesn't require hiding the status bar, hope it helps...
Best,
~ Ender Nafi
- Attachments
-
- zoomThing.zip
- (70.6 KiB) Downloaded 259 times
~... together, we're smarter ...~
__________________________________________
macOS Sierra • LiveCode 7 & xCode 8
__________________________________________
macOS Sierra • LiveCode 7 & xCode 8
-
- VIP Livecode Opensource Backer
- Posts: 114
- Joined: Fri Apr 28, 2006 12:10 am
- Location: Seattle
Re: Blank Snapshot in iOS
Ender, thank you so much for your patience and persistence.
Turns out your stack works and mine does not!!. I DO have the Status Bar hidden, but I find your stack works with or without the Status Bar! I need to play with your more sophisticated code to see if I'm missing something in mine. Standby....
And, thanks again!!
Roger
Turns out your stack works and mine does not!!. I DO have the Status Bar hidden, but I find your stack works with or without the Status Bar! I need to play with your more sophisticated code to see if I'm missing something in mine. Standby....
And, thanks again!!
Roger
endernafi wrote:Roger hi,
Could you hide the status bar from Standalone Application Settings and then give it a try please?
It seems that status bar causes the problem.
Edit:
I've attached a working sample which doesn't require hiding the status bar, hope it helps...
Best,
~ Ender Nafi
-
- VIP Livecode Opensource Backer
- Posts: 114
- Joined: Fri Apr 28, 2006 12:10 am
- Location: Seattle
Re: Blank Snapshot in iOS
Hi Ender et al,
I finally found the source of my problem. It turns out that I had "set the acceleratedRendering of this stack to true" on openStack. With this, Import Snapshot does NOT work in iOS (works fine in OS X)!. Once I commented this statement out, everything works fine!
Thanks to all for your help!
Roger
I finally found the source of my problem. It turns out that I had "set the acceleratedRendering of this stack to true" on openStack. With this, Import Snapshot does NOT work in iOS (works fine in OS X)!. Once I commented this statement out, everything works fine!
Thanks to all for your help!
Roger
RogGuay wrote:Ender, thank you so much for your patience and persistence.
Turns out your stack works and mine does not!!. I DO have the Status Bar hidden, but I find your stack works with or without the Status Bar! I need to play with your more sophisticated code to see if I'm missing something in mine. Standby....
And, thanks again!!
Roger
endernafi wrote:Roger hi,
Could you hide the status bar from Standalone Application Settings and then give it a try please?
It seems that status bar causes the problem.
Edit:
I've attached a working sample which doesn't require hiding the status bar, hope it helps...
Best,
~ Ender Nafi
-
- Livecode Opensource Backer
- Posts: 1336
- Joined: Sun Jul 12, 2009 10:53 am
- Location: Bordeaux, France
Re: Blank Snapshot in iOS
Roger..
I beg to differ... acceleratedRendering set to true does not cause a problem when using 'import snapshot' in iOS...
Dixie
I beg to differ... acceleratedRendering set to true does not cause a problem when using 'import snapshot' in iOS...
Dixie
-
- VIP Livecode Opensource Backer
- Posts: 296
- Joined: Wed May 02, 2012 12:23 pm
- Location: New York
- Contact:
Re: Blank Snapshot in iOS
Ok, I can confirm that.
After setting the acceleratedRendering of the stack to true,
the snapshot turns to a black square {img1}.
Setting it to false, the code works fine {img2}.
Tested in LiveCode 5.5.4, it looks like a bug...
Roger, I hope you don't need acceleratedRendering in your app
Best,
~ Ender Nafi
After setting the acceleratedRendering of the stack to true,
the snapshot turns to a black square {img1}.
Setting it to false, the code works fine {img2}.
Tested in LiveCode 5.5.4, it looks like a bug...
Roger, I hope you don't need acceleratedRendering in your app
Best,
~ Ender Nafi
~... together, we're smarter ...~
__________________________________________
macOS Sierra • LiveCode 7 & xCode 8
__________________________________________
macOS Sierra • LiveCode 7 & xCode 8
-
- Livecode Opensource Backer
- Posts: 1336
- Joined: Sun Jul 12, 2009 10:53 am
- Location: Bordeaux, France
Re: Blank Snapshot in iOS
Ender Nafi...
Then you must be doing something completely different to me... I have no problem with acceleratedRendering being on or off and calling the import snapshot command.... Every change of colour in this app triggers an import snapshot command and then lays the whole lot into an image in the background... I have just tested it in LC 5.5.3, 5.5.4 and LC 6.0.1... no difference.
Dixie
Then you must be doing something completely different to me... I have no problem with acceleratedRendering being on or off and calling the import snapshot command.... Every change of colour in this app triggers an import snapshot command and then lays the whole lot into an image in the background... I have just tested it in LC 5.5.3, 5.5.4 and LC 6.0.1... no difference.
Dixie
-
- VIP Livecode Opensource Backer
- Posts: 296
- Joined: Wed May 02, 2012 12:23 pm
- Location: New York
- Contact:
Re: Blank Snapshot in iOS
Dixie,
I have to clarify something.
The problem is about import snapshot from rect.
import snapshot from object works fine regardless of acceleratedRendering property.
I assume that you're using the latter in your code.
Could you try the import snapshot from rect structure in a spare time and tell whether it works or not?
Best,
~ Ender Nafi
I have to clarify something.
The problem is about import snapshot from rect.
import snapshot from object works fine regardless of acceleratedRendering property.
I assume that you're using the latter in your code.
Could you try the import snapshot from rect structure in a spare time and tell whether it works or not?
Best,
~ Ender Nafi
~... together, we're smarter ...~
__________________________________________
macOS Sierra • LiveCode 7 & xCode 8
__________________________________________
macOS Sierra • LiveCode 7 & xCode 8
-
- Livecode Opensource Backer
- Posts: 1336
- Joined: Sun Jul 12, 2009 10:53 am
- Location: Bordeaux, France
Re: Blank Snapshot in iOS
Ender...
I am also talking about importing a snapshot from a rectangle...
Above, part of a handler that is doing just that... and acceleratedRendering is set to true
Dixie
I am also talking about importing a snapshot from a rectangle...
Code: Select all
lock screen
/*changing the colour */
import snapshot from rectangle 0,0,320,436 of this card
set the points of grc "draw" to empty
delete image "canvas" of this card
set the name of the last image of this card to "canvas"
set the rect of image "canvas" of this card to 0,0,320,436
set the layer of image "canvas" to 1
unlock screen
Dixie
-
- VIP Livecode Opensource Backer
- Posts: 296
- Joined: Wed May 02, 2012 12:23 pm
- Location: New York
- Contact:
Re: Blank Snapshot in iOS
Thank you Dixie, I think I've found the problem { this time I'm sure }.
I {and probably Roger, too} was using import snapshot from rect tRect
You used import snapshot from rect tRect of this card.
When I added of this card, it suddenly worked.
It has to do with the implementation of the commands, I assume, based on the discussions on the user list.
Thanks again.
Roger,
I don't know if you keep following this thread,
but you don't need to temporarily turn off and on the a-R property.
Just use import snapshot from rect tRect of this card notation.
Best,
~ Ender Nafi
I {and probably Roger, too} was using import snapshot from rect tRect
You used import snapshot from rect tRect of this card.
When I added of this card, it suddenly worked.
It has to do with the implementation of the commands, I assume, based on the discussions on the user list.
Thanks again.
Roger,
I don't know if you keep following this thread,
but you don't need to temporarily turn off and on the a-R property.
Just use import snapshot from rect tRect of this card notation.
Best,
~ Ender Nafi
~... together, we're smarter ...~
__________________________________________
macOS Sierra • LiveCode 7 & xCode 8
__________________________________________
macOS Sierra • LiveCode 7 & xCode 8
-
- Livecode Opensource Backer
- Posts: 1336
- Joined: Sun Jul 12, 2009 10:53 am
- Location: Bordeaux, France
Re: Blank Snapshot in iOS
Nice one, Ender... I would not have picked up on that !...