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 / T2 GetCapturedImage() question

Author
Message
roujesky
20
Years of Service
User Offline
Joined: 4th Jun 2004
Location:
Posted: 30th Jun 2012 00:31
I execute the following code to get a picture:
if(!agk::IsCapturingImage ( ))
id = agk::GetCapturedImage() ;

Now that I have the image, how do I display that image?

thanks!
Hodgey
15
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 30th Jun 2012 04:01
I'd say the easiest way would be to just make a sprite:

int spr = agk::CreateSprite(id);

roujesky
20
Years of Service
User Offline
Joined: 4th Jun 2004
Location:
Posted: 30th Jun 2012 18:40
thanks for the response. that worked, kinda....
I only get part of the image to display.
what i want to do, eventually, is zoom in and out on the image. can a sprite allow me to do that?
here is my code, so far..

if(!agk::IsCapturingImage ( ))
mag_ID = agk::GetCapturedImage() ;
int spr = agk::CreateSprite(mag_ID);
I jacked around with setting the sprite size, but doesn't seem to do anything so far..

thanks!
roujesky
20
Years of Service
User Offline
Joined: 4th Jun 2004
Location:
Posted: 2nd Jul 2012 23:23
To clarify, I only see about 1/4th of the image when I display using
agk::CreateSprite(mag_ID);

when I look in the directory at the .png file, the image is all there.

Is there some scaling I need to do to the sprite? Or am I barking up the wrong tree using a sprite? Should I use something else?

thanks!
Hodgey
15
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 3rd Jul 2012 00:44
Try this:

agk::SetSpriteSize(mag_ID, agk::GetVirtualWidth(), agk::GetVirtualHeight() );

Login to post a reply

Server time is: 2024-11-23 17:07:46
Your offset time is: 2024-11-23 17:07:46