Image.importBitmap Method [AX 2012]

Clones a bitmap from the image that is specified by the hBitmap parameter.

public int importBitmap(int64 hBitmap)

Run On

Client

Parameters

hBitmap
Type: int64
The handle to the image that you clone.

Return Value

Type: int
0 indicates success; otherwise, failure.

The following example retrieves the handle for an image and then uses the importBitmap method to clone the image.

{ 
    int hdlBitmap; 
    Image img = new Image(); 
    Image img2 = new Image(); 
 
    img.loadImage(@'C:\MyImage.bmp'); 
    //Set hdlBitmap to handle for MyImage.bmp 
    hdlBitmap = img.exportBitmap(); 
 
    //Load MyImage.bmp to img2 using image handle 
    if (hdlBitmap) 
    { 
        img2.importBitmap(hdlBitmap); 
    } 
}

Community Additions

ADD
Show: