Sign in to follow this  

can i save images with alpha or Transapency ???

This topic is 4032 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi guys i am trying to save images from directx with transparency or Alpha , is that possible or not ?? in the Device.Clear(....) function i put the Clear Color of the World ( Transparent ) i am using to save the graphics the following Code : surface backBuffer = device.getbackbuffer(0,0,backbufferType.mono); SurfaceLoader.Save("MyPic.tga",ImageFileFormat.tga,backbuffer); if i can't save it with the transparency how could i do this ??? any ideas ???

Share this post


Link to post
Share on other sites
thanks evil steve for replying , well i save it as png but it was not saved as transparent also and instead of the transparent it gave white !! note that when i clear the device to transparent it give me a white color

Share this post


Link to post
Share on other sites
What format is your backbuffer? A8R8G8B8? And what exactly does your Clear() line look like? What happens if you clear to magenta or something? What are you using to check the alpha channel of the PNG? Photoshop?

Share this post


Link to post
Share on other sites
TGA does support alpha. It's kind of the default format for alpha use when exporting from Photoshop and the like, at least in my experience.

Share this post


Link to post
Share on other sites
Quote:
Original post by Evil Steve
What format is your backbuffer? A8R8G8B8?


well i don't know what format , i don't play with the back buffer settings, i create my device using :

device=new Device(adapterOrdinal,DeviceType.Hardware , picturebox1 , flags , presentparms);

Quote:
Original post by Evil Steve
And what exactly does your Clear() line look like? What happens if you clear to magenta or something?


and i clear it using :
device.Clear(ClearFlags.Target | ClearFlags.ZBuffer , Color.Transparent , 1.0f , 0);

if i change the color to magenta the green color will become magenta and same thing will happen to the texture the white will become magenta

Quote:
Original post by Evil Steve
What are you using to check the alpha channel of the PNG? Photoshop?

yup photoshop


Share this post


Link to post
Share on other sites
Quote:
Original post by jad_salloum
well i don't know what format , i don't play with the back buffer settings, i create my device using :

device=new Device(adapterOrdinal,DeviceType.Hardware , picturebox1 , flags , presentparms);

Well, your present params will contain a back buffer format. Don't use "unknown", if you're using that. Use a format with alpha.

Share this post


Link to post
Share on other sites

This topic is 4032 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this