2.2.6.22.12 PictureControl::SetMetaFile

Description

Sets a picture from a HMETAFILE to be displayed in the control

Syntax

BOOL SetMetaFile( HMETAFILE hMetafile, int nExtX, int nExtY, BOOL bTakeOwnership = TRUE )

Parameters

hMetafile
Handle to a Metafile
nExtX
Horizontal extent of the metafile in TWIPS
nExtY
Vertical extent of the metafile in TWIPS
bTakeOwnership
TRUE means that the control will destroy the object on destroy or on setting another picture

Return

return true when successful else false

Examples

EX1

#include <ocGDI.h>
#include <Control.h>

void PictureControl_SetMetaFile()
{
	PictureControl pc;
	string path = GetAppPath(TRUE) + "fgroup.ocs";
	RECT16 rect;
	HMETAFILE hmf = get_packed_metafile(path, "expdecy3", &rect);
	pc.SetMetaFile(hmf, rect.right, rect.bottom)
}

Remark

See Also

Header to Include

Control.h