Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

CStatic::SetEnhMetaFile 

Associates a new enhanced metafile image with the static control.


HENHMETAFILE SetEnhMetaFile(
   HENHMETAFILE hMetaFile 
);

Parameters

hMetaFile

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

The handle of the enhanced metafile previously associated with the static control, or NULL if no enhanced metafile was associated 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:

  • SS_ENHMETAFILE   Use this style always for enhanced metafiles.

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")) );
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.