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.

Author
Message
Grumpy Jedi
14
Years of Service
User Offline
Joined: 16th Jan 2010
Location:
Posted: 2nd May 2012 20:27
I was wondering if the GetImage command could have an option added to treat the screen background as transparency.

What I would like to be able to do is capture an image within my app with the SetClearColor() background treated as transparent so I could then save it as a .png with transparency.

Any chance that's a possibility in the future?
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 2nd May 2012 21:42
The background is already treated as transparent unless you set it I think. My Spriter example certainly had a transparent background.

bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 2nd May 2012 21:58
Baxslash, I am only getting a black rectangle using the getimage command. what am i doing wrong?
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 3rd May 2012 00:13
I answered in the other thread but basically you need to render or draw your sprites then call getImage, then call clearScreen.

bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 4th May 2012 11:34
I have tested GetImage on Windows7 and Windows8 using the latest Nvidia drivers and it is not grabbing the transparency or semi-transparency correctly. It is treating the background as black and hence semi-transparencies show on black = not very good for building masks
bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 4th May 2012 11:35
Another problem is that when using the Virtual resolution and AppGameKit adds black borders on the side, the GetImage command is taking into consideration these black borders and hence the X Y co-ords do not function well
bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 4th May 2012 11:46
This is the wrong way it is appearing:



This is the right way it should behave:

baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 4th May 2012 12:03
I can confirm that this works on my PC using the example code in this link: https://forumfiles.thegamecreators.com/download/2344424

...but on bjadams machine the same code does produces the image he has shown.

This would appear to be a graphics issue, my machine uses Windows Vista (up to date) and has a ATI FireGL V3100 graphics card. I haven't had a chance to try this code on my Nvidia machine yet but once I do I will post the results here.

bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 4th May 2012 14:26
Baxslash most probably it's an nvidia ogl thing rather than a windows one
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 4th May 2012 14:31
Yes, probably.

Login to post a reply

Server time is: 2024-05-02 00:32:34
Your offset time is: 2024-05-02 00:32:34