.
GDI+ FAQ
Skip Navigation LinksWelcome : GDI+ FAQ : Adding frames to a Multi-Frame TIFF

Adding frames to a Multi-Frame TIFF

Multi-page TIFF images are not directly editable inasmuch as you cannot open one up, slap a new image into it and then save it. You have to go through the process of opening the image, extracting the frames, creating a new TIFF image and saving all the frames back into it again.

The frames in a TIFF file can be selected using the SelectActiveFrame method and the contents of the successive frames extracted to separate bitmaps. A new multi-frame TIFF is then created and the images saved in-order to the new image.

The following application shown in Figure 1 and listed in C# and VB shows how to append or insert frames into an existing TIFF image.

Figure 1. The MultiTiffManager application

 

Here's how it works.

  • An image is loaded. If it has multiple frames, they are all extracted to separate images and then placed in a specialized ImageItem class. These ImageItems are used as items in an owner-drawn ListBox.

  • The ListBox displays each item as a graphic, you can scroll up and down the list to see the thumbnail of the images in the TIFF.

  • Appending an image adds a selected image to the end of the list.

  • Inserting an image places the image at the insert point designated by the numeric up-down control.

  • Removing an image deletes the item from the index specified in the numeric up-down control.

  • Save to a new TIFF using the "Done" button. This saves the first image in the list as the master and adds pages one at a time until all the pages in the list are saved into a single file.

Show me code in C#

Show me code in VB

Return to the GDI+ FAQ

Copyright � Bob Powell 2004. All rights reserved.

Sponsored By
DaraizeTechnologies.com

&
Proteus Groupe

Bob Powell

Create your badge

Copyright © Bob Powell 2000-2012.  All rights reserved.