Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / 1.071 - GetImage / SaveImage

Author
Message
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 5th May 2012 18:49
I have been unable to get the getImage() command to work, all I get is a black box. My example now colours the entire screen red to try and work out what is happening

Tiny project attached, can anyone comment on what I am doing wrong?

Attachments

Login to view attachments
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 5th May 2012 18:53
I havent looked at your code but this works for my mini map in my raycaster.

I use one single sprite for everything!



For some reason whas i forced to make the sprite depth to 0.
And i dont nead to use the render() command as it draws this on top and then grabbs it!
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 5th May 2012 19:20
Have you managed to get it to work?
Because if you use sprites you are trying to grabb so remember the reversed drawing order.
And to use the render() after you placed every sprite.

I didt nead that when i used one sprite and the draw command.
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 5th May 2012 19:28 Edited at: 5th May 2012 19:29
How strange, replacing Sync() with Render() works!

spr = createsprite(0)
setSpriteSize(spr, 320,480)
setSpritePosition(spr,0,0)
setSpriteColor(spr,255,0,0,255)
render() !!!
sleep(1000)
img = getImage(0,0,64,64)
saveImage(img, "test Image.png")

Thank you, your comments worked.

Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 5th May 2012 19:38
Quote: "How strange, replacing Sync() with Render() works!"

The same mistake i made the first time

The sync command emptys the backbuffer before it have time to grabb anything

If i remember it right

Always nice to help
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 5th May 2012 21:36
That's right cliff. Sync() clears the buffer for the next loop.

bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 5th May 2012 22:24
Now try to make it work on an iPhone 3gs with ios 4.2!

let me know if it works!!!

Login to post a reply

Server time is: 2024-05-03 05:52:35
Your offset time is: 2024-05-03 05:52:35