can i save images with alpha or Transapency ???

Started by
5 comments, last by ET3D 17 years, 4 months ago
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 ???
Advertisement
As far as I know, TGA doesn't support alpha. You'll need to save it as a format that does support alpha, like PNG or DDS.
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
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?
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.
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


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.

This topic is closed to new replies.

Advertisement