in

Data Techniques Forums

Appending multiple images into a tif file

Last post 02-19-2010 10:57 AM by brianb. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 02-19-2010 1:33 AM

    Appending multiple images into a tif file

    Hi All,

    Thank you for advance.

    How to create or Append multiple images into a tif file. i got the vb.code from data-tech.com. i need the assistant c#.

     

  • 02-19-2010 10:57 AM In reply to

    Re: Appending multiple images into a tif file

    The best way to create multipage tif files is to store each individual image in an ImageCollection instance. Then call the Save() method which has several overlaods. The easiest one is the Save method in which you pass the path and filename to be saved. For example:

    // Create new instance of an ImageCollection
    ImageCollection myCollection = new ImageCollection();

    // Add images to the collection  (this is just one of many ways to do so)
    myCollection.Add(ImImage.Load(@"C:\temp\images\firstImage.png"));
    myCollection.Add(ImImage.Load(@"C:\temp\images\secondImage.png"));
    myCollection.Add(ImImage.Load(@"C:\temp\images\thirdImage.png"));

    // Save the collection to a single tif image
    myCollection.Save(@"C:\temp\images\allImages.tif");

    Of course, if you are using the Viewer control, the Images property is an ImageCollection conveniently, so you can simply call:

    viewer1.Images.Save(...);

    Brian
    Technical Support
    Data Techniques
    Support Options
    Filed under:
Page 1 of 1 (2 items)
Copyright 2009 Data Techniques, Inc. All Rights Reserved.