Image.saveImage Method [AX 2012]

Saves the image to the specified file name.

public int saveImage(str fileName, [ImageSaveType Type])

Run On

Client

Parameters

fileName
Type: str
The name and location to save the file to.
Type
Type: ImageSaveType Enumeration
An ImageSaveType that enables you to specify that the file should be saved as a different format from that specified by the file extension; optional.

Return Value

Type: int
0 if the method was successful.

The possible values for the Type parameter are those available in the ImageSaveType system enum. For example, you could save test.bmp as a .jpg file.

0

Use_Extension

1

BMP

2

GIF

3

JPG

4

PNG

5

TIFF

6

BMP_UNCOMP

7

TIF_UNCOMP

The following example captures part of the screen to a file, and then loads that image.

Image img = new Image(); 
 
img.captureScreen(0, 0, 100, 100); 
img.saveImage(@'C:\test.bmp'); 
img.loadFile(@'C:\test.bmp'); 

Community Additions

ADD
Show: