Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CDC::SetTextColor always gives black. (must be Henry Ford)!

Status
Not open for further replies.

BM

Programmer
Apr 26, 2000
27
GB
Hi all<br>I am trying to set a text color to red and keep getting black, this also happens when I try to create a pen in red.&nbsp;&nbsp;Is this a palette fault? If not anyone know what it is?<br><br>Thanks<br><br>Barry
 
Dear Barry,<br><br>If you post the code that encapsulates your problem it will be easier to find a solution.<br><br>-pete
 
Hi Pete,<br>Thanks for the reply, the code is below<br><br><br><br>BOOL CFix::DrawFix(CDC* pDC)<br>{<br> CPen penFix;<br> int crad = 4;<br><br> if (!penFix.CreatePen(PS_SOLID, 1, RGB(256,0,0)))<br> return FALSE;<br> CPen* pOldPen = pDC-&gt;SelectObject( &penFix );<br> int crx1 = m_pointArray[0].x - crad;<br> int cry1 = m_pointArray[0].y + crad;<br> int crx2 = m_pointArray[0].x ;<br> int cry2 = m_pointArray[0].y - crad;<br> int crx3 = m_pointArray[0].x + crad;<br> int cry3 = m_pointArray[0].y + crad;<br> int crx4 = m_pointArray[0].x - crad;<br> int cry4 = m_pointArray[0].y - crad;<br><br> if (m_sIdLabel !=
 
Looks good so far, where is the drawing code? Also have you tried doing something simple in the device with color like filling a Rect?<br><br>-pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top