Sets the quality or the gray level of an image, or generates a thumbnail of the image with specified options.
Description
Generates an image according to the specified options.
Supported on mobile client only.
Syntax
image.of_createimagewithoptions
(
blob ablb_sourcefile
, string
as_targetfile
, eon_mobile_str_imageoption
astr_imageoption
, ref
eon_mobile_str_imageinfo astr_imageinfo
)
image.of_createimagewithoptions
(
string as_sourcefile
, string
as_targetfile
, eon_mobile_str_imageoption
astr_imageoption
, ref
eon_mobile_str_imageinfo astr_imageinfo
)
Argument Type |
Argument |
Description |
---|---|---|
eon_mobile_imageex |
|
The name of the eon_mobile_imageex object. |
blob |
|
The source file of the image (Blob data). |
string |
|
The location and file name of the source image. |
string |
as_targetfile
|
The location and file name of the generated
image. When file name is empty, no image will be
generated, only the blob data will be generated, and
if |
eon_mobile_str_imageoption |
astr_imageoption
|
The arguments for generating the target image. See variable list of eon_mobile_str_imageoption. |
eon_mobile_str_imageinfo |
astr_imageinfo
|
The information of the generated image. See variable list of eon_mobile_str_imageinfo. |
Return value
Integer
1 - Successful.
0 - Unknown error.
-1 - Invalid file location.
-2 - Argument error.
-3 - Failed to load the source image file.
-4 - Failed to save the generated image file.
-5 - Failed to compress the image to the specified size.
-6 - Insufficient memory.
-7 - File already exists.
Description
The options for generating the target image.
Property
Type |
Variable Name |
Description |
---|---|---|
long |
|
The width of the target image. If 0, then the original width will be used to generate the image. |
long |
|
The height of the target image. If 0, then the original height will be used to generate the image. |
integer |
|
The quality of the target image: [1, 10]. 10 indicates the original quality. If it is a different number other than 10, it indicates the quality of the target image and only JPG format will be supported and i_imagetype will be ignored. |
double |
|
When dbl_filesize (same as
Blob, unit is BYTE) is greater than zero,
i_quality will be ignored, and the
image quality will be automatically adjusted according
to the value of i_loopstep , and
therefore only JPG image type will be supported.
|
integer |
|
The percentage of the quality loss during compression: [1-9]. The number indicates the percentage level (1 is 10%, 9 is 90% etc.) that the quality will be reduced by. |
boolean |
|
Keep the aspect ratio during compression. When it is true, keep the aspect ratio. If the width aspect ratio (the target image width divided by the source image width) is less than the height aspect ratio (the target image height divided by the source image height), then the width aspect ratio will be used as the compression ratio, otherwise, the height aspect ratio will be used as the compression ratio. |
boolean |
|
Whether to return the indicator of the blob data. |
boolean |
|
Whether to gray out the target image. |
boolean |
|
Whether to overwrite the existing file. |
integer |
|
The supported image file type: 0 - JPG, & 1 - PNG |
boolean |
|
When true, the image will be generated at the
size of the content area (the image will be scaled to
fill up the content area, possibly anamorphically); when
false, the image will be generated at the size specified
by l_width and
l_height and will not be
scaled.
|
Description
The information of the generated image.
Property
Type |
Variable Name |
Description |
---|---|---|
long |
|
The width of the generated image. |
long |
|
The height of the generated image. |
integer |
|
The quality of the generated image: [1, 10]. 10 indicates the original quality. |
double |
|
The size of the generated image. |
blob |
|
The data of the generated image, only when
b_returnblob of eon_mobile_str_imageoption is
true, there is value of
ablb_filedata .
|