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.

Newcomers AppGameKit Corner / SaveImage() black color saved as transparent color.

Author
Message
Zigi
14
Years of Service
User Offline
Joined: 5th Jul 2009
Location:
Posted: 14th Feb 2016 14:41 Edited at: 14th Feb 2016 14:45
Hi.

I'm trying to save image using the following code, but in some cases, the black or dark color get saved as transparency:



This is the image I get when I use the above code:


But it should looks like this:


I don't set image or object transparency, so I don't understand why black color saved as transparency in some cases.
Anyone could help me please?

Thanks

Attachments

Login to view attachments
BatVink
Moderator
20
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 14th Feb 2016 15:58
Images are transparent by default.
The transparent colour is black by default
Try switching transparency off before you save.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
Zigi
14
Years of Service
User Offline
Joined: 5th Jul 2009
Location:
Posted: 14th Feb 2016 16:37 Edited at: 14th Feb 2016 16:38
Oh I see.

Actually, I have the problem with images used as textures on 3D objects but seems like I can't turn transparency off for images but sprites.
I have solved the problem by changing the transparent color of the image used as texture to something different that I don't use on the image but it works only as long I don't use that color

Thank you.
BatVink
Moderator
20
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 14th Feb 2016 20:04
Quote: "seems like I can't turn transparency off for images but sprites."


Oh yes, my bad.

SetImageTransparentColor() might still help.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt

Login to post a reply

Server time is: 2024-03-28 19:21:02
Your offset time is: 2024-03-28 19:21:02