Basic Image Manipulation
The sample form contains five button controls and one picture box control. The buttons initiate various image manipulation functions. The picture box displays the original image when the form first loads and the modified image after each manipulation. The application uses the sample image sample.gif
for all image manipulations, so you'll need to copy the file to your hard disk, and then change the value of the constant strFileName so that it contains the pathname of the copied sample.gif
file on your machine.
The simplest way to load an image is to call the System.Drawing.Image.FromFile
method with the pathname of the file you want to load, for example:
img = System.Drawing.Image.FromFile(strFileName);
method returns an Image object, which you can then manipulate or assign to the Image property of a PictureBox control.
pbImage.Image = img;
The method has a second optional Boolean parameter, with the exceptionally long name of useEmbeddedColorManagement
, which controls whether the Image object uses any color correction information embedded in the file. The default value of the parameter is false