Jump to content
  • Advertisement
Sign in to follow this  
shane1985

[.net] Best Way to Load a TGA

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

What is the best way to load a TGA in C#? I was looking at the Bitmap object, thinking that might work, but no luck. Does anyone have any suggestions on best to do this? Thanks -Shane

Share this post


Link to post
Share on other sites
Advertisement
kinda of a vague question but I know that if you are using managed dx the dxutil libraries can help you out and I believe there are even some GDI functions that like loadimage or something(i'm on my mac so I can't look it up right now) that may even do tga or jpg?

Share this post


Link to post
Share on other sites
Are you trying to load it to a Texture or to a Bitmap object?

The Bitmap object doesn't natively support .TGA files, so you'd have to write your own loader.

If you are looking to load it to a Texture, then you can use the TextureLoader class in Managed DirectX to load the targa file.

Share this post


Link to post
Share on other sites
Yeah I guess it was kind of vague - that's what happens at 2AM :)

Actually I use OpenGL, so I guess I'll just have to rewrite my own.

Now that I've figured out how to convert a byte[] array to an intptr, I think it should work.

Thanks
-Shane

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
http://www.gpwiki.org/index.php/TGA

Share this post


Link to post
Share on other sites
Targa is quite common is it not? I hope they're putting a targa loader in .NET 2.0...

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!