문제

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 file 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.

다른 팁

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/

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top