|
-
March 24th, 2001, 11:11 PM
#1
CStatic and Enhanced Metafiles
A CStatic control can display an enhanced metafile.
Loading an enhanced metafile from resources can be done in only a few steps. (Notice there is no error checking here.)
I do the following in OnInitDialog() to display a EMF in a CStatic.
CString strID;
strID.Format("#%d", IDR_ENHMETAFILE1);
HRSRC hRsrc = FindResource(NULL, strID, "ENHMETAFILE");
DWORD dwSize=SizeofResource(NULL, hRsrc);
HGLOBAL hGRes = LoadResource(NULL,hRsrc);
BYTE* prmf =(BYTE*)LockResource(hGRes);
HENHMETAFILE hMetaFile=SetEnhMetaFileBits(dwSize, prmf);
m_ctlPicture.SetEnhMetaFile(hMetaFile);
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|