Click here to Skip to main content
15,913,610 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: fire button when pressing enter in and edit box Pin
r00k136-Apr-04 18:59
r00k136-Apr-04 18:59 
GeneralRe: fire button when pressing enter in and edit box Pin
avenger_sb2511-Apr-04 18:02
avenger_sb2511-Apr-04 18:02 
GeneralFiltering of loaded files Pin
the lost zoyd6-Apr-04 4:17
the lost zoyd6-Apr-04 4:17 
GeneralRe: Filtering of loaded files Pin
Christian Graus6-Apr-04 10:41
protectorChristian Graus6-Apr-04 10:41 
QuestionWindows Message 0x0127? Pin
mangellj6-Apr-04 3:35
mangellj6-Apr-04 3:35 
AnswerRe: Windows Message 0x0127? Pin
avenger_sb256-Apr-04 11:26
avenger_sb256-Apr-04 11:26 
GeneralRe: Windows Message 0x0127? Pin
mangellj7-Apr-04 3:41
mangellj7-Apr-04 3:41 
QuestionChange colour of enhanced metafiles? Pin
JezzerP6-Apr-04 3:18
JezzerP6-Apr-04 3:18 
I am using enhanced metafiles in my MFC app to display simple, small, one colour images. The images themselves are pre-created in another drawing package. I was wondering whether it was possible to change the colour of the image prior to display on the screen....say from black to red. An example of the drawing function is given below:

code =============================================

void CSediStructure:: Draw(CDC* pDC)
{

// Get the metafile
HENHMETAFILE hemf = GetEnhMetaFile(m_sfStructureFile);

// Get a HANDLE to the device context
HDC hDC = pDC->m_hDC;

// Store the current WorldTransform structure
XFORM oldXForm;
GetWorldTransform(hDC, &oldXForm);

// Set the graphics Mode to "Advanced" so we can Transform the metafile if necessary
int nOldGraphicsMode = SetGraphicsMode(hDC, GM_ADVANCED);

// Perform any transforms (rotation)
if(m_dRotationAngle != 0)
Rotate(m_dRotationAngle, m_nAnchor, hDC);

// "Play" the metafile to the screen
PlayEnhMetaFile(hDC, hemf, m_BoundingRect);

// Free metafile resource and reset the graphics mode
DeleteEnhMetaFile(hemf);
SetWorldTransform(hDC, &oldXForm);
SetGraphicsMode(hDC, nOldGraphicsMode);
}

code =============================================


I've found the MSDN info on functions like GetEnhMetaFilePaletteEntries() but I'm not sure how it all works and whether I can actually do what I want to do.

Any help would be appreciated.

thanks

JezzerPSmile | :)

___________________________
Jeremy Preston

AnswerRe: Change colour of enhanced metafiles? Pin
John R. Shaw6-Apr-04 16:22
John R. Shaw6-Apr-04 16:22 
GeneralRe: Change colour of enhanced metafiles? Pin
JezzerP6-Apr-04 21:44
JezzerP6-Apr-04 21:44 
GeneralConvert PDF to TXT Pin
Jay.Jay6-Apr-04 2:39
Jay.Jay6-Apr-04 2:39 
GeneralRe: Convert PDF to TXT Pin
Paul Ranson6-Apr-04 3:01
Paul Ranson6-Apr-04 3:01 
GeneralAdd new Button to Outlook Pin
Anonymous6-Apr-04 2:28
Anonymous6-Apr-04 2:28 
GeneralRe: Add new Button to Outlook Pin
David Crow6-Apr-04 7:18
David Crow6-Apr-04 7:18 
GeneralUCHAR to CString Pin
packetlos6-Apr-04 2:28
packetlos6-Apr-04 2:28 
GeneralRe: UCHAR to CString Pin
Rory Solley6-Apr-04 3:39
Rory Solley6-Apr-04 3:39 
GeneralRe: UCHAR to CString Pin
jmkhael6-Apr-04 3:39
jmkhael6-Apr-04 3:39 
GeneralRe: UCHAR to CString Pin
David Crow6-Apr-04 3:44
David Crow6-Apr-04 3:44 
GeneralRe: UCHAR to CString Pin
John R. Shaw6-Apr-04 16:35
John R. Shaw6-Apr-04 16:35 
GeneralInvalid Argument Pin
sschilachi6-Apr-04 2:18
sschilachi6-Apr-04 2:18 
GeneralRe: Invalid Argument Pin
David Crow6-Apr-04 3:35
David Crow6-Apr-04 3:35 
GeneralRe: Invalid Argument Pin
sschilachi6-Apr-04 5:31
sschilachi6-Apr-04 5:31 
GeneralRe: Invalid Argument Pin
David Crow6-Apr-04 5:42
David Crow6-Apr-04 5:42 
AnswerRe: An invalid argument was encountered Pin
rhfritz121-Apr-10 3:04
rhfritz121-Apr-10 3:04 
Questionuser defined events? Pin
nurpinar6-Apr-04 2:17
nurpinar6-Apr-04 2:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.