Foxite.COM Community Weblog

Foxite.COM Community Weblog - free weblog service for the Visual FoxPro Community.
Welcome to Foxite.COM Community Weblog Sign in | Join | Help
in
Home Blogs Forum Photos Forum Archives

VFP IMAGING



How to Extract frames from MultiPage TIFFs

Here's the link of a UTMAG article that covers the TIFF subject deeply:
TIFF and the new GdiPlusX classes


At the topic "Extracting frames from TIFFS" you'll find the code below, that saves the frames of a TIFF in separate image files:

** HOWTO: Extract frames from a Multiframe TIFF

DO LOCFILE("System,prg") 

WITH _SCREEN.System.Drawing

* Load the multiframe TIFF to GDI+
LOCAL loMultif AS xfcBitmap
loMultif = .Bitmap.New(GETPICT("TIF"))
LOCAL lnFrames, n, lcFrameFileName
lnFrames = loMultif.GetFrameCount()
IF lnFrames > 1
   FOR n = 0 TO lnFrames - 1
      loMultif.SelectActiveFrame(.Imaging.FrameDimension.Page, n)       
      lcFrameFileName = "c:\Frame" + TRANSFORM(n + 1) + ".Tif"
      loMultif.Save(lcFrameFileName, .Imaging.ImageFormat.Bmp)
   ENDFOR
ELSE
   MESSAGEBOX("The selected file is not a Multiframe TIFF")
ENDIF 

ENDWITH 
RETURN
Published Saturday, November 03, 2007 12:58 PM by cesarchalom
Filed Under:

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

No Comments

What do you think?

(required) 
(optional)
(required)