Share via


Image.importBitmap(Int64) Method

Definition

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

public:
 virtual int importBitmap(long _hBitmap);
public virtual int importBitmap (long _hBitmap);
abstract member importBitmap : int64 -> int
override this.importBitmap : int64 -> int
Public Overridable Function importBitmap (_hBitmap As Long) As Integer

Parameters

_hBitmap
Int64

The handle to the image that you clone.

Returns

0 indicates success; otherwise, failure.

Remarks

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); 
    } 
}

Applies to