Click here to Skip to main content
15,907,492 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: C++ Exception Pin
T.RATHA KRISHNAN15-Jun-07 1:39
T.RATHA KRISHNAN15-Jun-07 1:39 
AnswerRe: C++ Exception Pin
Russell'15-Jun-07 2:15
Russell'15-Jun-07 2:15 
QuestionRe: C++ Exception Pin
T.RATHA KRISHNAN15-Jun-07 2:50
T.RATHA KRISHNAN15-Jun-07 2:50 
AnswerRe: C++ Exception Pin
Russell'15-Jun-07 3:19
Russell'15-Jun-07 3:19 
QuestionFuction prototype in .C or .H Pin
krishnakumar7514-Jun-07 2:06
krishnakumar7514-Jun-07 2:06 
AnswerRe: Fuction prototype in .C or .H Pin
James R. Twine14-Jun-07 2:18
James R. Twine14-Jun-07 2:18 
AnswerRe: Fuction prototype in .C or .H Pin
Russell'14-Jun-07 4:15
Russell'14-Jun-07 4:15 
QuestionDrawing a text over a picture control Pin
eli1502197914-Jun-07 1:31
eli1502197914-Jun-07 1:31 
Hi,

I added a picture control to my form and choose the BitMap type and loaded a bitmap into that control.
Now I need to draw text over that bitmap.
The problem is that the text is being drawn behind that bitmap and not above it(therefor - I can't see the text).
I use the following peace of code :
HBRUSH Frm_WkAtol::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
	HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);

	// TODO:  Change any attributes of the DC here
	CRect rect;
	CRgn  rgn;
	switch(pWnd->GetDlgCtrlID())
	{
		case IDC_ATOL_CORRIDOR_BITMAP:
		{
			CRect TextRect;
			CDC *pLabelDC = m_AtolCorridorBitmap.GetDC();
			m_AtolCorridorBitmap.GetClientRect(&rect);
			TextRect = rect;
			TextRect.top = rect.top + 10;
			TextRect.bottom = TextRect.top + 25;
			TextRect.left = rect.left + 25;
			TextRect.right = rect.right - 25;
			pLabelDC->DrawText(_T("Test") , &TextRect , DT_CENTER);
			ReleaseDC(pLabelDC);
		}
		break;
	}

	return hbr;
}


Note - if I change the type of the picture control to
a Rectangle,I can see the text.
Doe's it mean that I need to draw the Bitmap by myself???

With best regards,
Eli
AnswerRe: Drawing a text over a picture control Pin
shiraztk14-Jun-07 7:29
shiraztk14-Jun-07 7:29 
AnswerRe: Drawing a text over a picture control Pin
Mark Salsbery14-Jun-07 7:40
Mark Salsbery14-Jun-07 7:40 
GeneralRe: Drawing a text over a picture control Pin
eli1502197915-Jun-07 1:16
eli1502197915-Jun-07 1:16 
GeneralRe: Drawing a text over a picture control Pin
Mark Salsbery15-Jun-07 6:05
Mark Salsbery15-Jun-07 6:05 
AnswerRe: Drawing a text over a picture control Pin
tyagineha14-Jun-07 18:05
tyagineha14-Jun-07 18:05 
GeneralRe: Drawing a text over a picture control Pin
Hamid_RT14-Jun-07 19:57
Hamid_RT14-Jun-07 19:57 
AnswerRe: Drawing a text over a picture control Pin
Hamid_RT14-Jun-07 19:56
Hamid_RT14-Jun-07 19:56 
QuestionProperty sheets Pin
rajeevktripathi14-Jun-07 1:23
rajeevktripathi14-Jun-07 1:23 
AnswerRe: Property sheets Pin
James R. Twine14-Jun-07 1:57
James R. Twine14-Jun-07 1:57 
QuestionRe: Property sheets Pin
rajeevktripathi19-Jun-07 20:10
rajeevktripathi19-Jun-07 20:10 
AnswerRe: Property sheets Pin
James R. Twine19-Jun-07 23:58
James R. Twine19-Jun-07 23:58 
QuestionCListctrl Pin
mehrdadov14-Jun-07 1:14
mehrdadov14-Jun-07 1:14 
AnswerRe: CListctrl Pin
Naveen14-Jun-07 1:28
Naveen14-Jun-07 1:28 
AnswerRe: CListctrl Pin
Arman S.14-Jun-07 2:11
Arman S.14-Jun-07 2:11 
QuestionSendMessage crashes Pin
Wim Engberts14-Jun-07 1:05
Wim Engberts14-Jun-07 1:05 
GeneralRe: SendMessage crashes Pin
Matthew Faithfull14-Jun-07 1:42
Matthew Faithfull14-Jun-07 1:42 
AnswerRe: SendMessage crashes Pin
James R. Twine14-Jun-07 1:44
James R. Twine14-Jun-07 1:44 

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.