Link to home
Start Free TrialLog in
Avatar of zimmer9
zimmer9Flag for United States of America

asked on

Do you know how, using C#, to increase the size of 2 merged images that are displayed vertically (one image on top and one image on the bottom, of the scren) in 1 file?

Using the following code, I create 2 check images that are displayed vertically (the front image on top and the back image on the bottom) from 1 file.

The bad news is that the front check image is taking up about 1/4 of the top of the screen and the back check image is taking up about 1/4 of the bottom half of the screen, which makes their contents hard to read.

Do you know how to revise this code so that the front check image will take up the entire upper half of the screen and the
back check image will take up the entire bottom half of the screen?

I have attached a display of the (small) size and the position of the 2 check images on the screen.


                                                     MemoryStream ms = new MemoryStream(bytesFrImg, 0, bytesFrImg.Length);
                                                     ms.Write(bytesFrImg, 0, bytesFrImg.Length);
                                                     System.Drawing.Image image = System.Drawing.Image.FromStream(ms, true);
                                                     
                                                     MemoryStream ms1 = new MemoryStream(bytesBkImg, 0, bytesBkImg.Length);
                                                     ms1.Write(bytesBkImg, 0, bytesBkImg.Length);
                                                     System.Drawing.Image image1 = System.Drawing.Image.FromStream(ms1, true);
                                                 
                                                     string combinedTif = @"L:\\FINSYS\\FSMain\\C\\Source\\B1.tiff";
                                                     Bitmap combinedBitmap = new Bitmap(Math.Max(image.Width, image1.Width), image.Height + image1.Height);
                                           
                                                         using (Graphics combinedGraphics = Graphics.FromImage(combinedBitmap))
                                                         {
                                                             combinedGraphics.Clear(Color.Black);
                                                             combinedGraphics.DrawImage(image, new Point(0, 0));
                                                             combinedGraphics.DrawImage(image1, new PointF(0, image.Height));

                                                             if (File.Exists(combinedTif))
                                                             {
                                                                 File.Delete(combinedTif);
                                                             }

                                                             combinedBitmap.Save(combinedTif);
B.tiff
ASKER CERTIFIED SOLUTION
Avatar of Shaun Vermaak
Shaun Vermaak
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial