LEADTOOLS Image File Support (Leadtools.Codecs assembly)

SaveStamp(RasterImage,Stream,Int32,Int32,Int32,CodecsSavePageMode) Method

Show in webframe







The Leadtools.RasterImage object that contain the thumbnail (stamp) image.
A System.IO.Stream containing the data of an existing image file.
1-based index of the first page in image to save.
1-based index of the last page in image to save. Pass -1 to save from firstPage to the last page in image.
1-based index of the first output page. If the output file already exists, then this parameter lets you control which pages to overwrite and/or where to append the new pages.

Determines how to handle the page when saving to multipage formats. This can be one of the following:

Value Meaning
CodecsSavePageMode.Append Append the new page(s) to the end of the file. If the file does not exist, this option will create the file and add the pages to it. firstSavePageNumber is not used.
CodecsSavePageMode.Insert Insert the new page(s) at the index specified by firstSavePageNumber.
CodecsSavePageMode.Replace Replace the page(s) starting at the index specified by firstSavePageNumber.
CodecsSavePageMode.Overwrite Overwrite the page(s) starting at the index specified by firstSavePageNumber.
Saves a stamp in an existing stream with specific options.
Syntax
public void SaveStamp( 
   RasterImage image,
   Stream stream,
   int firstPage,
   int lastPage,
   int firstSavePageNumber,
   CodecsSavePageMode pageMode
)
'Declaration
 
Public Overloads Sub SaveStamp( _
   ByVal image As RasterImage, _
   ByVal stream As Stream, _
   ByVal firstPage As Integer, _
   ByVal lastPage As Integer, _
   ByVal firstSavePageNumber As Integer, _
   ByVal pageMode As CodecsSavePageMode _
) 
'Usage
 
Dim instance As RasterCodecs
Dim image As RasterImage
Dim stream As Stream
Dim firstPage As Integer
Dim lastPage As Integer
Dim firstSavePageNumber As Integer
Dim pageMode As CodecsSavePageMode
 
instance.SaveStamp(image, stream, firstPage, lastPage, firstSavePageNumber, pageMode)
public void SaveStamp( 
   RasterImage image,
   Stream stream,
   int firstPage,
   int lastPage,
   int firstSavePageNumber,
   CodecsSavePageMode pageMode
)
-(BOOL)     saveStamp:(LTRasterImage*)image
               stream:(LTLeadStream*)stream
            firstPage:(unsigned int)firstPage
             lastPage:(int)lastPage
  firstSavePageNumber:(unsigned int)firstSavePageNumber
             pageMode:(LTCodecsSavePageMode)pageMode
                error:(NSError**)outError;
            
public void saveStamp(RasterImage image, ILeadStream stream, int firstPage, int lastPage, int firstSavePageNumber, CodecsSavePageMode pageMode)
 function Leadtools.Codecs.RasterCodecs.SaveStamp(RasterImage,Stream,Int32,Int32,Int32,CodecsSavePageMode)( 
   image ,
   stream ,
   firstPage ,
   lastPage ,
   firstSavePageNumber ,
   pageMode 
)
public:
void SaveStamp( 
   RasterImage^ image,
   Stream^ stream,
   int firstPage,
   int lastPage,
   int firstSavePageNumber,
   CodecsSavePageMode pageMode
) 

Parameters

image
The Leadtools.RasterImage object that contain the thumbnail (stamp) image.
stream
A System.IO.Stream containing the data of an existing image file.
firstPage
1-based index of the first page in image to save.
lastPage
1-based index of the last page in image to save. Pass -1 to save from firstPage to the last page in image.
firstSavePageNumber
1-based index of the first output page. If the output file already exists, then this parameter lets you control which pages to overwrite and/or where to append the new pages.
pageMode

Determines how to handle the page when saving to multipage formats. This can be one of the following:

Value Meaning
CodecsSavePageMode.Append Append the new page(s) to the end of the file. If the file does not exist, this option will create the file and add the pages to it. firstSavePageNumber is not used.
CodecsSavePageMode.Insert Insert the new page(s) at the index specified by firstSavePageNumber.
CodecsSavePageMode.Replace Replace the page(s) starting at the index specified by firstSavePageNumber.
CodecsSavePageMode.Overwrite Overwrite the page(s) starting at the index specified by firstSavePageNumber.
Remarks

The stamp will be written to last page in the file. If that page already has a stamp, it will be overwritten; If the file to which the stamp is being written does not exist, an exception will occur.

This method works for regular JPEG files and Exif JPEG files. For regular JPEG files, the stamp saved is always uncompressed and can be 8 or 24 bits per pixel. The stamp can be any width and height, but the stamp data and stamp header must completely fit in an APP0 marker. Therefore, the size must be less than 64k bytes (0xFFFF).

For Exif JPEG files, the stamps can be uncompressed or JPEG compressed and must be 24 bits per pixel. Exif JPEG stamps are supposed to be 160 x 120. However, LEADTOOLS can save and read Exif JPEG stamps of other dimensions. The stamp, along with other information such as the TIFF_HEADER, 0th IFD, 1st IFD, etc. must completely fit in an APP1 marker. Therefore, the size must be less than 64k bytes (0xFFFF).

NOTE: At this time, there are no multipage formats that support stamps.

Example
For an example, refer to SaveStamp(RasterImage,String,Int32,Int32,Int32,CodecsSavePageMode).
Requirements

Target Platforms

See Also

Reference

RasterCodecs Class
RasterCodecs Members
Overload List
Implementing Extended FlashPix Support

 

 


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