

You may examine that code from the IDE if you so desire but it won't be discussed in this article. The image variable "img" is used to provide form level exposure to the current image this was done here to make the image available to any of the form method calls that require access to the image.įollowing the variable declarations, there is a section of default code added to the project through the Visual Studio IDE. The string variable "CurrentFile" is used to store the name of the current, working image file (as loaded into the form's picture box). The class declaration is equally simple: using System įollowing the class declaration and library imports, a few local variables are declared to support file management within the application across each of the class methods: // local variable declarations

The class begins with the using statements the imports include the standard and default inclusions as well as an added reference to. The main application's form class (Form1.vb) contains all of the application code needed to make the file conversions and to open a file into the application's image viewer (which is nothing more than a standard picture box control). The contents of the solution show that it contains a single project entitled, "ImageConverter". This project contains a single form called "Form1". The Form1.vb class contains all of the code necessary to drive the utility.Ī quick check of the references will reveal that only the default class libraries are contained in the project and the Program.cs file is a unedited version of the default version of that file. In order to get started, unzip the attachment and load the solution into Visual Studio 2005. Examine the solution explorer and note the files contained in the project:įigure 2: The Solution Explorer Showing the Project Files NET 2.0 Imaging class library's conversion methods. In addition to demonstrating the approach used to achieve the file conversions, the application also demonstrates an approach used to open an image file into a picture box control.įigure 1: The Image Conversion Utility In Use The supported file types addressed in the application are:Īll file conversions are accomplished through the use of the Microsoft. This article describes a very easy approach to building an image conversion utility that will permit the user to open a supported image type and convert it to another supported image type.
