LEADTOOLS Image File Support (Leadtools.Codecs assembly)

CompactFile(Stream,Stream,Int32,Int32,Boolean,Int32,Int32,Boolean,Int32,CodecsSavePageMode,Boolean,Boolean) Method

Show in webframe







A System.IO.Stream containing the data of the file being compacted. All the pages will be read from this stream.
A System.IO.Stream that will contain the written data.
Value that represents the number of pages to copy. Use 0 to copy all the pages. If pages is > 0, only pages will be copied to destStream.
Specifies the start page in the source stream. Page 1 is the first page, page 2 is the second page, etc. The pages will be read starting with this page.
true to use srcIfd as the stream offset of the first page. false to use srcStartPage.

Offset into the source stream for the start page. Used only if useSrcIfd is true.

All pages will be relative to that page. (Note that this might not be the first physical page in the stream). This is a common technique for manipulating files with thousands of pages.

0 to overwrite destStream. <>0 to append the pages to the end of the stream.
true to use destIfd as the stream offset of the first page. false to use destStartPage.

Offset into the destination stream for the start page. Used only if useDestIfd is true.

All pages will be relative to that page. (Note that this might not be the first physical page in the stream). This is a common technique for manipulating files with thousands of pages.

Flag which indicates the save page mode.
Value Meaning
CodecsSavePageMode.Insert All pages are inserted before destStartPage.
CodecsSavePageMode.Replace Pages in destStream are replaced beginning with destStartPage.
true to have the TGSUBFILETYPE tag stripped from all pages in the destination file.
true to save pages in Motorola byte order. false to save pages in Intel byte order. This only applies when creating a new file. When updating existing files, the byte order of the original file is used.
Compacts TIFF streams with specific options.
Syntax
public void CompactFile( 
   Stream srcStream,
   Stream destStream,
   int pages,
   int srcStartPage,
   bool useSrcIfd,
   int srcIfd,
   int destStartPage,
   bool useDestIfd,
   int destIfd,
   CodecsSavePageMode pageMode,
   bool noSubFileType,
   bool motorolaOrder
)
'Declaration
 
Public Overloads Sub CompactFile( _
   ByVal srcStream As Stream, _
   ByVal destStream As Stream, _
   ByVal pages As Integer, _
   ByVal srcStartPage As Integer, _
   ByVal useSrcIfd As Boolean, _
   ByVal srcIfd As Integer, _
   ByVal destStartPage As Integer, _
   ByVal useDestIfd As Boolean, _
   ByVal destIfd As Integer, _
   ByVal pageMode As CodecsSavePageMode, _
   ByVal noSubFileType As Boolean, _
   ByVal motorolaOrder As Boolean _
) 
'Usage
 
Dim instance As RasterCodecs
Dim srcStream As Stream
Dim destStream As Stream
Dim pages As Integer
Dim srcStartPage As Integer
Dim useSrcIfd As Boolean
Dim srcIfd As Integer
Dim destStartPage As Integer
Dim useDestIfd As Boolean
Dim destIfd As Integer
Dim pageMode As CodecsSavePageMode
Dim noSubFileType As Boolean
Dim motorolaOrder As Boolean
 
instance.CompactFile(srcStream, destStream, pages, srcStartPage, useSrcIfd, srcIfd, destStartPage, useDestIfd, destIfd, pageMode, noSubFileType, motorolaOrder)
public void CompactFile( 
   Stream srcStream,
   Stream destStream,
   int pages,
   int srcStartPage,
   bool useSrcIfd,
   int srcIfd,
   int destStartPage,
   bool useDestIfd,
   int destIfd,
   CodecsSavePageMode pageMode,
   bool noSubFileType,
   bool motorolaOrder
)

            

            
 function Leadtools.Codecs.RasterCodecs.CompactFile(Stream,Stream,Int32,Int32,Boolean,Int32,Int32,Boolean,Int32,CodecsSavePageMode,Boolean,Boolean)( 
   srcStream ,
   destStream ,
   pages ,
   srcStartPage ,
   useSrcIfd ,
   srcIfd ,
   destStartPage ,
   useDestIfd ,
   destIfd ,
   pageMode ,
   noSubFileType ,
   motorolaOrder 
)
public:
void CompactFile( 
   Stream^ srcStream,
   Stream^ destStream,
   int pages,
   int srcStartPage,
   bool useSrcIfd,
   int srcIfd,
   int destStartPage,
   bool useDestIfd,
   int destIfd,
   CodecsSavePageMode pageMode,
   bool noSubFileType,
   bool motorolaOrder
) 

Parameters

srcStream
A System.IO.Stream containing the data of the file being compacted. All the pages will be read from this stream.
destStream
A System.IO.Stream that will contain the written data.
pages
Value that represents the number of pages to copy. Use 0 to copy all the pages. If pages is > 0, only pages will be copied to destStream.
srcStartPage
Specifies the start page in the source stream. Page 1 is the first page, page 2 is the second page, etc. The pages will be read starting with this page.
useSrcIfd
true to use srcIfd as the stream offset of the first page. false to use srcStartPage.
srcIfd

Offset into the source stream for the start page. Used only if useSrcIfd is true.

All pages will be relative to that page. (Note that this might not be the first physical page in the stream). This is a common technique for manipulating files with thousands of pages.

destStartPage
0 to overwrite destStream. <>0 to append the pages to the end of the stream.
useDestIfd
true to use destIfd as the stream offset of the first page. false to use destStartPage.
destIfd

Offset into the destination stream for the start page. Used only if useDestIfd is true.

All pages will be relative to that page. (Note that this might not be the first physical page in the stream). This is a common technique for manipulating files with thousands of pages.

pageMode
Flag which indicates the save page mode.
Value Meaning
CodecsSavePageMode.Insert All pages are inserted before destStartPage.
CodecsSavePageMode.Replace Pages in destStream are replaced beginning with destStartPage.
noSubFileType
true to have the TGSUBFILETYPE tag stripped from all pages in the destination file.
motorolaOrder
true to save pages in Motorola byte order. false to save pages in Intel byte order. This only applies when creating a new file. When updating existing files, the byte order of the original file is used.
Remarks

This method can also be used to copy or extract one or more pages from a TIFF file and copy them without recompression to another TIFF file. Whenever you save an image containing a region as a TIFF file format, the region is also saved. Note, however, that the ability to save a region inside a TIFF file must be unlocked. This requires a Document Imaging or Medical Imaging toolkit.

Example
For an example, refer to CompactFile(String,String,Int32).
Requirements

Target Platforms

See Also

Reference

RasterCodecs Class
RasterCodecs Members
Overload List

 

 


Products | Support | Contact Us | Copyright Notices
© 2006-2014 All Rights Reserved. LEAD Technologies, Inc.