// Creates a thumbnail 100 pixels wide maintaining aspect ratio.
// Determine appropriate height.
int newHeight = 100 * igPage.DIB.Height / igPage.DIB.Width;
// Set default interpolation to none.
ImGearInterpolations igInterpolations = ImGearInterpolations.NONE;
// If the image is 1-bit and larger than 100x100, use grayscale interpolation.
if (igPage is ImGearRasterPage &&
1 == igPage.DIB.BitDepth &&
igPage.DIB.Width >= 100 &&
igPage.DIB.Height >= 100)
{
igInterpolations = ImGearInterpolations.GRAYSCALE;
}
// Create the thumbnail using the default options for the chosen interpolation.
ImGearPage igPageThumbnail = ImGearProcessing.CreateThumbnail(igPage, 100, newHeight,
ImGearInterpolationOptions.GetDefault(igInterpolations));