2.7.10 expImage
Menu Information
File: Export: Image
(When Matrix window is active)
Brief Information
Export image to file
Command Line Usage
1. expImage fname:="c:\flower";
2. expImage im:=[Mbook1]1 type:=tif fname:=c:\flower;
3. expimage -t mytheme f:="c:\ExportedUsingTheme";
X-Function Execution Options
Please refer to the page for additional option switches when accessing the x-function from script
Variables
Display Name
|
Variable Name
|
I/O and Type
|
Default Value
|
Description
|
Input Matrix
|
im
|
Input
MatrixObject
|
<active>
|
The image to export. The default is the active image.
|
File Type
|
type
|
Input
int
|
bmp
|
Specify the export type.
Option list
- bmp:BMP
- Export to BMP file.
- gif:GIF
- Export to GIF file.
- jpg:JPG
- Export to JPG file.
- pcx:PCX
- Export to PCX file.
- png:PNG
- Export to PNG file.
- psd:PSD
- Export to PSD file.
- tga:TGA
- Export to TGA file.
- tif:TIF
- Export to TIF file.
|
File Name
|
fname
|
Input
string
|
fname$
|
Specify the path and filename of the exported image. If file extension is omitted, it will be appended according to the file type.
|
Image Settings
|
tr
|
Input
TreeNode
|
<unassigned>
|
Specify the image settings. Note that different settings are available for different file types. For all types, you can specify the DPI resolution and color depth. When JPG is selected for File Type, you can further specify the compression ratio. As for TIFF, both the color space and compression method are available.
See more details in Description table
|
Description
The expImage function exports a matrix object as an image file. The matrix object of any data type can be used as input, but it might be converted to another data type according to the settings and output type.
Eight export file types (BMP, GIF, JPEG, TIFF etc) are supported. Users can choose among them according to their needs. In addition, the TIFF file format includes an Export as Grayscale GeoTIFF output option with separate treenode settings.
You can also specify DPI resolution, color depth, etc. using the Image Settings tree in the dialog. Please select a file type before you use this tree, because different settings are available for different file types.
Details on TreeNode Dialog Options
-
- Please see this page for details by file type.
- Please see this page for details of grayscale GeoTIFF export.
Examples
1. The following example exports the active matrix object as a JPEG image file (c:\test.jpg):
- a. From the Origin menu, select File: Export: Image. This opens the expASC dialog for you to tweak the export options.
- b. Use the File Type drop-down list to select "Joint Photographic Experts Group *.jpg". Enter "c:\test.jpg" for File Name. Click Ok to close the dialog.
2. The following script command exports the active matrix object as a BMP file (c:\test.bmp) without opening the dialog:
expImage fname:="c:\test.bmp" type:=0;
Related X-Functions
impImage, expMatASC
Keywords:publishing
|