You've encountered one of the most irritating things about .NET (at least for me): image processing is quite wanting. I don't work with TGA much, but I work extensively with TIFF. The .NET imaging libraries either do not support TIFF readily, such as PictureBox, or the support for conversion of certain types to BMP such that PictureBox would accept it is lacking. A good example is JPEG compressed TIFF. Neither the old style .NET imaging classes nor the much superior WPF imaging classes (which can be used in WinForms) support that compression method.
Long story short, you have two options:
Use a more robust imaging library such as Magick.NET to convert your TIFF and TGA images to BMP so that you can use a PictureBox directly.
Find a third party image viewer control that will support the image types you need.
Either way you'll find yourself using a third party library for the heavy lifting.
Then your two options have become one option. You'll need to use a third party library to convert the image to a format PictureBox likes. I say a third party library because .NET's built in imaging libraries may likely still cause you problems due to lack of support for the source image type.
However, as deceptikon mentioned in his reply, some types (compressions) of TIFF format are not natively supported under .NET framework. So you need to use a programming SDK (leadtools) to load such images in code and convert them to compatible GDI+ image object to load it in picture box
I am writing a java program that needs to execute shell commands, so I wrote a function that would take the command to execute as a string (ie: "mkdir ~/Folder1") and execute that command with the shell. Here is the function:
Runtime run = Runtime.getRuntime();
Process pr = ...
Hi, as I was told that my code doesn’t scale well at all, I thought perhaps I’d try to get a better understanding of interfaces/abstract classes and classes and the relationship between them.
I don’t want at this stage work on a big separate project as I've already got plenty ...
Hi. I have a form with list box : lst_product, datagridview : grd_order and button: btn_addline. lst_product has a list of product ids selected from database (MS Acess 2013) , grd_order is by default empty except for 2 headers and btn_addline adds rows to grd_order.