Jump to content
  • Advertisement
Sign in to follow this  
dali

D3DXSaveTextureToFile problem with Png

This topic is 4059 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

Hello! I seem to have a problem with D3DXSaveTextureToFile if i want to save the texture in the png format. Bmp, jpg etc work all fine but if i try to save the texture in png format the function fails. The texture is in A8R8G8B8 format so there shouldnt be a problem. What could be the problem? Thanks a lot!!

Share this post


Link to post
Share on other sites
Advertisement
This works for me all the time. Is D3D spitting out any Debug information?

Dave

Share this post


Link to post
Share on other sites
No special information comes the function just fails and does not save the png at all. Its just weird because all the other formats work perfectly well.

Share this post


Link to post
Share on other sites
Quote:
Original post by dali
No special information comes the function just fails and does not save the png at all. Its just weird because all the other formats work perfectly well.
Define "Fails". Does it return some error code? What does it return? Does it crash? If so, what is the exact crash type (E.g. "Access violation reading 0x00000000")? Are you using the debug runtimes and linking to "d3dx9d.lib" for debug builds? D3DX will spit out debug information when a function fails.

EDIT: And what SDK version are you using?

[Edited by - Evil Steve on May 13, 2007 9:56:24 AM]

Share this post


Link to post
Share on other sites
This is very very strange. With d3dx9d.lib it works great :D I use directx9a there must be something with the directx code.

Share this post


Link to post
Share on other sites
Quote:
Original post by dali
This is very very strange. With d3dx9d.lib it works great :D I use directx9a there must be something with the directx code.
Can we see some relevant code? If anything, it should work with the retail one and not the debug once (Since the debug runtime does more sanity checking).

Is there any reason you're not using the latest SDK? It's entirely possible that this is a bug in D3DX which has been fixed in a later SDK.

Share this post


Link to post
Share on other sites
Hmm i havent switched because some methods like text drawing etc changed in the directx9c and i have not had time to change these. But now i believe i have to switch because i dont think this is a bug in my code for it works with all other formats and it mysteriously also in debug mode. But thanks a lot!! I will let you know if switching to the newest version helped.

Share this post


Link to post
Share on other sites
Yeah the directx code was wrong. With the latest SDK everything works wonderful :) Thanks again

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!