.NET Framework Bookmark and Share   
 index > .NET Base Class Library > TIFF Image need to attach on the right side of another Tiff Image and Finally save without losing quality of image
 

TIFF Image need to attach on the right side of another Tiff Image and Finally save without losing quality of image

Hi All,

Here is a problem of TIFF Image manipulation. A TIFF Image need to attach on the right side of another TIFF Image allready exisisting. Then save as a single Tiff image without losing the TIFF format. ie, Merging both the TIFF Frames to One.Is there any method In the System.Windows.Media namespace or any other namespace.

Thanks
madhav
madhav_1
Just create a new image by drawing the originals side-by-side. Using System.Drawing:

public static Image JoinImages(Image image1, Image image2) {
Bitmap bmp = new Bitmap(image1.Width + image2.Width, Math.Max(image1.Height, image2.Height));
using (Graphics gr = Graphics.FromImage(bmp)) {
gr.Clear(Color.AntiqueWhite);
gr.DrawImage(image1, 0, 0, image1.Width, image1.Height);
gr.DrawImage(image2, image1.Width, 0, image2.Width, image2.Height);
}
return bmp;
}

Call the Save() method on the return value to save as a tiff.

Hans Passant.
  • Marked As Answer bymadhav_1 Tuesday, September 22, 2009 6:12 AM
  •  
nobugz
Hi nobugz,

Thanks for your replay.
Anyway I too have tried this method before. Here the Tiff format losing its quality. That is the problem

Thanks once again,

madhav
  • Marked As Answer bymadhav_1 Tuesday, September 22, 2009 6:12 AM
  •  
madhav_1
Please start a new thread for your new question.

Hans Passant.
  • Marked As Answer bymadhav_1 Tuesday, September 22, 2009 6:12 AM
  •  
nobugz
Use the Image and Graphics classes of System.Drawing namespace. If you must use WPF, post to the WPF forum.
JohnWein
Just create a new image by drawing the originals side-by-side. Using System.Drawing:

public static Image JoinImages(Image image1, Image image2) {
Bitmap bmp = new Bitmap(image1.Width + image2.Width, Math.Max(image1.Height, image2.Height));
using (Graphics gr = Graphics.FromImage(bmp)) {
gr.Clear(Color.AntiqueWhite);
gr.DrawImage(image1, 0, 0, image1.Width, image1.Height);
gr.DrawImage(image2, image1.Width, 0, image2.Width, image2.Height);
}
return bmp;
}

Call the Save() method on the return value to save as a tiff.

Hans Passant.
  • Marked As Answer bymadhav_1 Tuesday, September 22, 2009 6:12 AM
  •  
nobugz
Hi nobugz,

Thanks for your replay.
Anyway I too have tried this method before. Here the Tiff format losing its quality. That is the problem

Thanks once again,

madhav
  • Marked As Answer bymadhav_1 Tuesday, September 22, 2009 6:12 AM
  •  
madhav_1
Please start a new thread for your new question.

Hans Passant.
  • Marked As Answer bymadhav_1 Tuesday, September 22, 2009 6:12 AM
  •  
nobugz

You can use google to search for other answers

Custom Search

More Threads

• How to Unit Test this Method?
• Bad UID
• splitting web.config file
• Send DataSet by ref
• How to fire events across different process
• USB MIDI access through windows MIDI API
• Allow only 1 instance of program
• Databinding of Combobox using C#.Net
• Get string with escape character
• Active Directory access from non-Domain box?