Click here to Skip to main content
15,891,629 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Question[Message Deleted] Pin
Newbie0021-Feb-07 4:06
Newbie0021-Feb-07 4:06 
AnswerRe: Querry regarding DoModal Pin
David Crow21-Feb-07 4:09
David Crow21-Feb-07 4:09 
AnswerRe: Querry regarding DoModal Pin
toxcct21-Feb-07 4:10
toxcct21-Feb-07 4:10 
AnswerRe: [Message Deleted] Pin
ThatsAlok21-Feb-07 6:22
ThatsAlok21-Feb-07 6:22 
GeneralRe: [Message Deleted] Pin
Hamid_RT21-Feb-07 7:11
Hamid_RT21-Feb-07 7:11 
GeneralRe: [Message Deleted] Pin
Newbie0021-Feb-07 23:27
Newbie0021-Feb-07 23:27 
GeneralRe: [Message Deleted] Pin
ThatsAlok22-Feb-07 0:00
ThatsAlok22-Feb-07 0:00 
QuestionHow to draw a bitmap on top of button? Pin
Igor Jerosimic21-Feb-07 1:27
Igor Jerosimic21-Feb-07 1:27 
I want to draw a small arrow bitmap on top of already drawn button. I tried with calling default drawing proc before my code for drawing bitmap but it gives me some error.

OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct)<br />
{<br />
CDialog::OnDrawItem(nIDCtl, lpDrawItemStruct);<br />
<br />
HDC thdc = CreateCompatibleDC(lpDrawItemStruct->hDC);<br />
HGDIOBJ tobj = SelectObject(thdc, LoadBitmap(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDB_ARROW_DOWN)));<br />
TransparentBlt(lpDrawItemStruct->hDC, lpDrawItemStruct->rcItem.right - 20, lpDrawItemStruct->rcItem.top + (lpDrawItemStruct->rcItem.bottom - lpDrawItemStruct->rcItem.top - 16) / 2, 16, 16, thdc, 0, 0, 16, 16, RGB(255, 0, 255));<br />
SelectObject(thdc, tobj);<br />
DeleteDC(thdc);<br />
}


if i exclude "CDialog::OnDrawItem(nIDCtl, lpDrawItemStruct);" then code works, but there is no borders and caption text, just my bitmap.
AnswerRe: How to draw a bitmap on top of button? Pin
Naveen21-Feb-07 1:44
Naveen21-Feb-07 1:44 
GeneralRe: How to draw a bitmap on top of button? Pin
Igor Jerosimic21-Feb-07 2:03
Igor Jerosimic21-Feb-07 2:03 
GeneralRe: How to draw a bitmap on top of button? Pin
Naveen21-Feb-07 2:09
Naveen21-Feb-07 2:09 
GeneralRe: How to draw a bitmap on top of button? Pin
prasad_som21-Feb-07 2:15
prasad_som21-Feb-07 2:15 
GeneralRe: How to draw a bitmap on top of button? Pin
Naveen21-Feb-07 2:18
Naveen21-Feb-07 2:18 
AnswerRe: How to draw a bitmap on top of button? Pin
prasad_som21-Feb-07 3:02
prasad_som21-Feb-07 3:02 
GeneralRe: How to draw a bitmap on top of button? Pin
Naveen21-Feb-07 16:13
Naveen21-Feb-07 16:13 
AnswerRe: How to draw a bitmap on top of button? Pin
prasad_som21-Feb-07 18:37
prasad_som21-Feb-07 18:37 
GeneralRe: How to draw a bitmap on top of button? Pin
Naveen21-Feb-07 19:52
Naveen21-Feb-07 19:52 
GeneralRe: How to draw a bitmap on top of button? Pin
Igor Jerosimic21-Feb-07 23:37
Igor Jerosimic21-Feb-07 23:37 
GeneralRe: How to draw a bitmap on top of button? Pin
Naveen21-Feb-07 23:53
Naveen21-Feb-07 23:53 
GeneralRe: How to draw a bitmap on top of button? Pin
Igor Jerosimic22-Feb-07 0:03
Igor Jerosimic22-Feb-07 0:03 
GeneralRe: How to draw a bitmap on top of button? Pin
Igor Jerosimic26-Feb-07 0:24
Igor Jerosimic26-Feb-07 0:24 
GeneralRe: How to draw a bitmap on top of button? Pin
Naveen26-Feb-07 2:08
Naveen26-Feb-07 2:08 
GeneralRe: How to draw a bitmap on top of button? Pin
Igor Jerosimic26-Feb-07 2:16
Igor Jerosimic26-Feb-07 2:16 
GeneralRe: How to draw a bitmap on top of button? Pin
Naveen26-Feb-07 2:24
Naveen26-Feb-07 2:24 
GeneralRe: How to draw a bitmap on top of button? Pin
Igor Jerosimic26-Feb-07 2:27
Igor Jerosimic26-Feb-07 2:27 

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.