Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Append TIFF Onto TIFF
Message
General information
Forum:
ASP.NET
Category:
Pictures and Image processing
Miscellaneous
Thread ID:
01493963
Message ID:
01493987
Views:
53
>I'm trying to create a multi page tiff from 2 seperate tiffs:
>
>
>public static void AppendToTiff(string TargetTiff, string TiffToAdd)
>{
>    Image img1 = Image.FromFile(TargetTiff);
>    Image img2 = Image.FromFile(TiffToAdd);
>    int Height = img1.Height + img2.Height;
>    int Width = img1.Width;
>
>    string path = Path.GetDirectoryName(TargetTiff);
>    string tempfile = path + "\\" + Path.GetFileNameWithoutExtension(Path.GetTempFileName()) + ".tiff";
>
>    using (Bitmap newImg = new Bitmap(Width, Height))
>    {
>        Graphics g = Graphics.FromImage(newImg);
>        g.DrawImage(img1, 0, 0);
>        g.DrawImage(img2, 0, Height);
>        g.Save();
>        newImg.Save(tempfile);
>    }
>}
>
>
>The result is one tiff, the correct size, but with only the first image showing at the top. Anyone know how to do this?

Almost :-} Try:
g.DrawImage(img2, 0, img1.Height);
Previous
Reply
Map
View

Click here to load this message in the networking platform