Foxit PDF SDK offers following image types:
-
BMP: bitmap image format. It only support single frame. Foxit PDF SDK supports to load image from a BMP image file, get some basic information, get its bitmap, change its bitmap and save it as an image file.
-
JPG: joint photographic experts group image format. It only support single frame. Foxit PDF SDK supports to load image from a JPG image file, get some basic information, get its bitmap, change its bitmap and save it as an image file.
-
PNG: portable network graphics image format. It only support single frame. Foxit PDF SDK supports to load image from a PNG image file, get some basic information, get its bitmap, change its bitmap and save it as an image file.
-
GIF: graphics interchange format. It supports multiple frames. Foxit PDF SDK supports to load image from a GIF image file, get its size, get its bitmap, change its bitmap and save it as an image file.
-
TIF: tagged image file format. It supports multiple frames. Foxit PDF SDK supports to load image from a TIF image file, get some basic information, get its bitmap, change its bitmap and save it as an image file.
-
JPX: JPEG-2000 image format. It only support single frame. Foxit PDF SDK supports to load image from a JPX image file, get its size, get its bitmap, change its bitmap and save it as an image file.
-
JBIG2: JBIG2 image format. It only support single frame. Foxit PDF SDK supports to load image from a JBIG2 image file, get its size, and save it as an image file. Foxit PDF SDK does not support to get its frame bitmap yet.
| FSDK.Image.SaveAs |
( |
|
file_path | ) |
|
|
inline |
Save current image as an image file.
If the type of current image is FSDK.Image.e_TIF, FSDK.Image.e_GIF or FSDK.Image.e_None, 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.
If the bitmap format of current image is FSDK.Bitmap.e_DIB1bpp, only FSDK.Image.e_BMP, FSDK.Image.e_PNG and FSDK.Image.e_TIF types are supported for the saved 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.
- Parameters
-
| [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. |
- Returns
- true means success, while false means failure.
- Note
- This function does not support to save current image object just back to the image file which is used to construct current image object. In order to do so, user is recommended to do as following steps:
Assume that current image object is constructed from an image file named "org.bmp".
-
Use current function to save current image object to an temporary file. Here, this temporary file is named as "temp.tmp".
-
Ensure that current image object has destructed.
-
Remove "org.bmp" and rename "temp.tmp" to "org.bmp".
| FSDK.Image.SaveAs |
( |
|
file, |
|
|
|
file_extension |
|
) |
| |
|
inline |
Save current image as an image file.
If the type of current image is FSDK.Image.e_TIF, FSDK.Image.e_GIF or FSDK.Image.e_None, 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.
If the bitmap format of current image is FSDK.Bitmap.e_DIB1bpp, only FSDK.Image.e_BMP, FSDK.Image.e_PNG and FSDK.Image.e_TIF types are supported for the saved 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.
- Parameters
-
| [in] | file | A FSDK.StreamCallback 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. |
- Returns
- true means success, while false means failure.
- Note
- This function does not support to save current image object just back to the image file which is used to construct current image object. In order to do so, user is recommended to do as following steps:
Assume that current image object is constructed from an image file named "org.bmp".
-
Use current function to save current image object to an temporary file. Here, this temporary file is named as "temp.tmp".
-
Ensure that current image object has destructed.
-
Remove "org.bmp" and rename "temp.tmp" to "org.bmp".