Wpf: Image Control does not support .TGA files
In my application I am using Images, these images can be .tga(Targa Graphic) file as well, when I am creating instance of BitmapImage using .tga file, it throws exception saying "No imaging component suitable to complete this operation was found.".
Is there any other way to work with .tga 开发者_如何学JAVAfile in wpf? How can I use these(.tga) files just like any other .jpg(Image file) in wpf?
FreeImage is a free open source library for images and it has a c# wrapper.
http://www.netframeworkdev.com/windows-presentation-foundation-wpf/wpf--load-image-from-stream--error-no-imaging-component-found-75844.shtml
try this
TGA is not a very widespread format... The exception means exactly what it says : WPF doesn't have a suitable decoder for this format. You will have to convert it to a known format.
Can't vouch for the quality of this project, but you might look here: http://www.codeproject.com/KB/graphics/TargaImage.aspx
Here's the TGA specification if you want to roll your own: local.wasp.uwa.edu.au/~pbourke/dataformats/tga/
精彩评论