Foxit PDF SDK
|
Instance Methods | |
(BOOL) | - addFrame: |
Add a bitmap as a frame. (Unsupported DIB formats: FSBitmapDIBRgb565 and FSBitmapDIB8bppMask) More... | |
(FSBitmap *) | - getFrameBitmap: |
Get a frame bitmap, specified by index. More... | |
(int) | - getFrameCount |
Get frame count. More... | |
(int) | - getHeight |
Get image height. More... | |
(FSImageType) | - getType |
Get image type. More... | |
(int) | - getWidth |
Get image width. More... | |
(int) | - getXDPI |
Get DPI for X-axis. More... | |
(int) | - getYDPI |
Get DPI for Y-axis. More... | |
(id) | - init |
Constructor. More... | |
(id) | - initWithBuffer: |
Constructor, from a memory buffer. More... | |
(id) | - initWithFile_read: |
Constructor, with a file read callback object. More... | |
(id) | - initWithOther: |
Constructor, with another image object. More... | |
(id) | - initWithPath: |
Constructor, from an existing image file path. More... | |
(BOOL) | - isEmpty |
Check whether current object is empty or not. More... | |
(BOOL) | - saveAs: |
Save current image as an image file. More... | |
(BOOL) | - saveAsWithStreamCallback:file_extension: |
Save current image as an image file. More... | |
(void) | - setDPIs:y_dpi: |
Set DPI for X-axis and Y-axis. More... | |
Foxit PDF SDK offers following image types:
- (BOOL) addFrame: | (FSBitmap*) | bitmap |
Add a bitmap as a frame. (Unsupported DIB formats: FSBitmapDIBRgb565 and FSBitmapDIB8bppMask)
Currently, this function does not support an image with type FSImageJBIG2, or FSImageUnknown .
For supporting image types:
[in] | bitmap | A valid bitmap as a frame to be added or set. |
- (FSBitmap *) getFrameBitmap: | (int) | index |
Get a frame bitmap, specified by index.
Currently, this function does not support an image with type FSImageJBIG2. This function can only support to get a frame bitmap which is in following formats:
FSBitmapDIB8bppMask, FSBitmapDIB8bpp, FSBitmapDIBRgb, FSBitmapDIBRgb32, FSBitmapDIBArgb.
For other unsupported DIB format, this function will return a bitmap object which's function Bitmap::isEmpty returns YES.
[in] | index | Index of the frame. Valid range: from 0 to (count-1). count is returned by function Image::getFrameCount. |
- (int) getFrameCount |
Get frame count.
Currently, this function does not support an image with type FSImageJBIG2.
- (int) getHeight |
Get image height.
If the image has multiple frames, usually the first frame's size will be treated as the image size.
- (FSImageType) getType |
Get image type.
If current image is a new image (not constructed from any image file), its type would be FSImageNone.
- (int) getWidth |
Get image width.
If the image has multiple frames, usually the first frame's size will be treated as the image size.
- (int) getXDPI |
Get DPI for X-axis.
Currently, this function does not support an image with type FSImageJPX, FSImageGIF or FSImageJBIG2.
For a new image (not constructed from any image file), the default DPI for X-axis is 96.
- (int) getYDPI |
Get DPI for Y-axis.
Currently, this function does not support an image with type FSImageJPX, FSImageGIF or FSImageJBIG2.
For a new image (not constructed from any image file), the default DPI for Y-axis is 96.
- (id) init |
Constructor.
This constructor is to construct a new image object (without any data). The image type of this constructed image object would be FSImageNone.
- (id) initWithBuffer: | (NSData *) | buffer |
Constructor, from a memory buffer.
[in] | buffer | A memory buffer. The image file data should be fully loaded in this memory buffer. It should not be nil. |
- (id) initWithFile_read: | (id<FSFileReaderCallback>) | file_read |
Constructor, with a file read callback object.
[in] | file_read | A FSFileReaderCallback object which is implemented by user to load an image file. It should not be nil. |
- (id) initWithOther: | (FSImage*) | other |
Constructor, with another image object.
[in] | other | Another image object. |
- (id) initWithPath: | (NSString *) | path |
Constructor, from an existing image file path.
[in] | path | A full path of an existing image file. It should not be an empty string. |
- (BOOL) isEmpty |
Check whether current object is empty or not.
When the current object is empty, that means current object is useless.
- (BOOL) saveAs: | (NSString *) | file_path |
Save current image as an image file.
If the type of current image is FSImageTIF, FSImageGIF or FSImageNone, and the saved image file type does not support multiply frames, only the first frame of current image will be saved to the image file.
For an image object (not constructed from any image file), please ensure to add at least one valid frame bitmap to the image object before using this function; otherwise this function will fail.
[in] | file_path | A full path of the saved image file. It should not be an empty string. Currently, this function supports following extension names: .bmp, .jpg, .jpeg, .png, .tif, .tiff, .jpx, .jp2. |
- (BOOL) saveAsWithStreamCallback: | (id<FSFileStreamCallback>) | file | |
file_extension: | (NSString *) | file_extension | |
Save current image as an image file.
If the type of current image is FSImageTIF, FSImageGIF or FSImageNone, and the saved image file type does not support multiply frames, only the first frame of current image will be saved to the image file.
For an image object (not constructed from any image file), please ensure to add at least one valid frame bitmap to the image object before using this function; otherwise this function will fail.
[in] | file | A FSFileStreamCallback object which is implemented by user to save image file. |
[in] | file_extension | A full path of the saved image file. It should not be an empty string. Currently, this function supports following extension names: .bmp, .jpg, .jpeg, .png, .tif, .tiff, .jpx, .jp2. |
- (void) setDPIs: | (int) | x_dpi | |
y_dpi: | (int) | y_dpi | |
Set DPI for X-axis and Y-axis.
Currently, this function does not support an image with type FSImageJPX, FSImageGIF, or FSImageJBIG2.
[in] | x_dpi | DPI for X-axis. It should be above 0. |
[in] | y_dpi | DPI for Y-axis. It should be above 0. |