CStatic::SetEnhMetaFile

HENHMETAFILE SetEnhMetaFile( HENHMETAFILE hMetaFile );

Return Value

The handle of the enhanced metafile previously associated with the static control, or NULL if no enhanced metafile was associated with the static control.

Parameters

hMetaFile

Handle of the enhanced metafile to be drawn in the static control.

Remarks

Call this member function to associate a new enhanced metafile image with the static control.

The enhanced metafile will be automatically drawn in the static control. The enhanced metafile is scaled to fit the size of the static control.

You can use various window and static control styles, including the following:

Example

CStatic myStatic;

// Create a child enhanced metafile static control.
myStatic.Create(_T("my static"), 
   WS_CHILD|WS_VISIBLE|SS_ENHMETAFILE|SS_CENTERIMAGE, 
   CRect(10,10,150,50), pParentWnd);

// Set the image of the static control to be "myemf.emf."
myStatic.SetEnhMetaFile( ::GetEnhMetaFile(_T("myemf.emf")) );

CStatic OverviewClass MembersHierarchy Chart

See Also   CStatic::GetEnhMetafile, STM_SETIMAGE