Overview
This example is pretty simple. You just use .NET functionality to convert images to types LabVIEW doesn't support.
Description
Make sure you change the output file extensions to match your image type. It will still work if you don't, but there's a good chance normal image readers won't know what to do with the file if asked to open it. This would be akin to running a .pdf as a .exe (just doesn't make a lot of sense).
.NET Supports a few other image types that LabVIEW doesn't.
.NET ImageFormat contains the following types:
The example shows two methods of conversion. One uses the Image object and just loads then saves the file. The second uses the Bitmap and Graphics objects and redraws the image into a new width/height. These objects have lots more functionality so feel free to modify the image in more interesting ways using them!
The second example allows the user to change the resolution and bit depth. It also allows the user to fill in the background. Some image formats allow for "blank" pixels. When viewied in various programs, these pixels could be displayed as either black or white. This example fills in the backgroudn with white pixels. Finally, this example also displays a converted bmp file in the LabVIEW picture control. Because this control only accepts 24 bit RGB images, the original image must be converted from 32 bit RGB to 24 bit RGB.
This example uses .NET 4.0 (see http://digital.ni.com/public.nsf/allkb/32B0BA28A72AA87D8625782600737DE9 for example of how to get this .NET version to work in LabVIEW). These classes existed in .NET 2.0 so you can remap the objects instead of adding the .config file if you wish.
Requirements
Steps to Implement or Execute Code
Additional Information or References
VI Snippet of "NET Image Converter 2012 NIVerified.vi"
VI Snippet of "NET Image Converter and Bmp Display 2012 NIVerified.vi"
**This document has been updated to meet the current required format for the NI Code Exchange.**
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.
Does this image resizing software have free trial version, im finding a robust image processing program for my work, can anybody give me some useful suggestion?
I want to know that the quality of image file converted by this .NET image converter SDK. Can it achieve lossless image conversion?
It is showing that drawing.dll is missing.