The classes ImGearProcessing Class, ImGearRasterProcessing Class, and ImGearEffects Class present a set of methods for modifying an image. You do not need to create an ImGearProcessing Class object to call its methods since all methods are static. Any method takes an image to be processed and some additional parameters necessary for processing the operation. For example, the Rotate Method will be called as follows:
ImGearProcessing.Rotate(Page, ImGearRotationValues.VALUE_90);
Image processing methods are shown below:
The C# samples given below illustrate how to work with some Image Processing methods (in the samples, assume that igPage is a valid object of type ImGearPage Class):
Rotate
C# |
Copy Code |
// Rotate the page to 45 degrees and expand according to the new image
// size. The background will be set to black.
// Create background color object
ImGearPixel igPixelBackground = new ImGearPixel(igPage.DIB.ChannelCount,
igPage.DIB.BitsPerChannel);
// Rotate
ImGearProcessing.Rotate(igPage, 45, ImGearRotationModes.EXPAND, igPixelBackground); |
Crop
C# |
Copy Code |
// Cut a quarter of an image from left, top, right and bottom
int cutWidth = igPage.DIB.Width / 4;
int cutHeight = igPage.DIB.Height / 4;
// Crop
ImGearProcessing.Crop(igPage, cutWidth, cutHeight, 2 * cutWidth, 2 * cutHeight); |
AdjustContrast
C# |
Copy Code |
double contrast = 1.2;
double brightness = 64;
double gamma = 1.5;
ImGearRasterProcessing.AdjustContrast((ImGearRasterPage)igPage, contrast, brightness, gamma); |
See Also