I am developing a C# application using VS2010 and .Net Framework 4.0
I use the following function to combine 2 check image files into 1 check image file with one check image appearing below the other.
However, the output image files created are rather large in file size.
Can you suggest a way I can shrink the size of the output image files and there is a lot of empty space between the 2 check images
in the output check image file.
public static void ProcessImage(string checkImgPrefix, string directory)
{
string tif1 = directory + checkImgPrefix + "_Front.tif";
string tif2 = directory + checkImgPrefix + "_Rear.tif";
string tif3 = directory + checkImgPrefix + ".ard.out";
Image img1 = Image.FromFile(tif1);
Image img2 = Image.FromFile(tif2);
int width = Math.Max(img1.Width, img2.Width);
int height = img1.Height + img2.Height;
Bitmap img3 = new Bitmap(width, height);
Graphics g = Graphics.FromImage(img3);
g.Clear(Color.Black);
g.DrawImage(img1, new Point(0, 0));
g.DrawImage(img2, new Point(0, img1.Height));
g.Dispose();
img1.Dispose();
img2.Dispose();
img3.Save(tif3, System.Drawing.Imaging.ImageFormat.Tiff);
img3.Dispose();
}
Our community of experts have been thoroughly vetted for their expertise and industry experience.
The Fellow title is reserved for select members who demonstrate sustained contributions, industry leadership, and outstanding performance. We will announce the experts being inducted into the Experts Exchange Fellowship during the annual Expert Awards, but unlike other awards, Fellow is a lifelong status. This title may not be given every year if there are no obvious candidates.
The Most Valuable Expert award recognizes technology experts who passionately share their knowledge with the community, demonstrate the core values of this platform, and go the extra mile in all aspects of their contributions. This award is based off of nominations by EE users and experts. Multiple MVEs may be awarded each year.