Click here to Skip to main content
16,005,491 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CPP,MFC,.DEF Files Pin
Bram van Kampen11-Apr-06 15:02
Bram van Kampen11-Apr-06 15:02 
QuestionHow to draw a bit map when mouse is pressed ? Pin
Surivevoli9-Apr-06 12:51
Surivevoli9-Apr-06 12:51 
AnswerRe: How to draw a bit map when mouse is pressed ? Pin
Bram van Kampen9-Apr-06 13:55
Bram van Kampen9-Apr-06 13:55 
GeneralRe: How to draw a bit map when mouse is pressed ? Pin
Surivevoli9-Apr-06 14:15
Surivevoli9-Apr-06 14:15 
GeneralRe: How to draw a bit map when mouse is pressed ? Pin
Bram van Kampen9-Apr-06 14:47
Bram van Kampen9-Apr-06 14:47 
GeneralRe: How to draw a bit map when mouse is pressed ? Pin
Surivevoli9-Apr-06 15:52
Surivevoli9-Apr-06 15:52 
GeneralRe: How to draw a bit map when mouse is pressed ? Pin
Waldermort9-Apr-06 15:54
Waldermort9-Apr-06 15:54 
GeneralRe: How to draw a bit map when mouse is pressed ? Pin
Surivevoli9-Apr-06 16:14
Surivevoli9-Apr-06 16:14 
of course as you say about overlap
the thing that i want say is how to paint a bitmap when mouse click event happened and location that bitmap is drawed is belong to coordinate of mouse !
i tryed many code but if i minimize the dialog of program,
then nothing to see!

void CGomokuDlg::OnMouseMove(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
if((nFlags & MK_LBUTTON)== MK_LBUTTON)
{
//get Device context:
CClientDC dcc(this);
//draw pixel:
dcc.SetPixel(point.x,point.y,RGB(0,0,0));
}

CDialog::OnMouseMove(nFlags, point);

}

void CGomokuDlg::OnLButtonDown(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default

CClientDC dc(this); // device context for painting

CBitmap bitmap;
bitmap.LoadBitmap (IDB_BITMAP1);

CDC dcMem;
dcMem.CreateCompatibleDC(&dc);
CBitmap* pOldBitmap = dcMem.SelectObject(&bitmap);

CPen pen1(PS_SOLID,16, RGB(255,100,0));
dc.SelectObject(&pen1);
//dc.StretchBlt(100, 130, 20, 20, &dcMem,
// 0, 0, 20, 20, SRCCOPY);
dc.MoveTo(0,0);
dc.LineTo(30,400);


CDialog::OnLButtonDown(nFlags, point);
}


-- modified at 22:14 Sunday 9th April, 2006
AnswerRe: How to draw a bit map when mouse is pressed ? Pin
Laxman Auti10-Apr-06 0:51
Laxman Auti10-Apr-06 0:51 
QuestionOpenFileDialog Pin
EhsB9-Apr-06 10:52
EhsB9-Apr-06 10:52 
QuestionKeyboard hook code explanation Pin
EvScott9-Apr-06 8:38
EvScott9-Apr-06 8:38 
AnswerRe: Keyboard hook code explanation Pin
PJ Arends9-Apr-06 10:04
professionalPJ Arends9-Apr-06 10:04 
AnswerRe: Keyboard hook code explanation Pin
Bram van Kampen9-Apr-06 15:01
Bram van Kampen9-Apr-06 15:01 
QuestionHOW TO DETECT MEMORY LEAKS Pin
Rafael Fernández López9-Apr-06 7:32
Rafael Fernández López9-Apr-06 7:32 
AnswerRe: HOW TO DETECT MEMORY LEAKS Pin
sunit59-Apr-06 19:12
sunit59-Apr-06 19:12 
QuestionSTL Qs Pin
RalfPeter9-Apr-06 6:10
RalfPeter9-Apr-06 6:10 
AnswerRe: STL Qs Pin
Chris Losinger9-Apr-06 7:07
professionalChris Losinger9-Apr-06 7:07 
AnswerRe: STL Qs Pin
Jörgen Sigvardsson9-Apr-06 10:40
Jörgen Sigvardsson9-Apr-06 10:40 
QuestionCArray of CBrush and CRgn Pin
stifmeister_ro9-Apr-06 6:10
stifmeister_ro9-Apr-06 6:10 
AnswerRe: CArray of CBrush and CRgn Pin
Michael Dunn9-Apr-06 7:15
sitebuilderMichael Dunn9-Apr-06 7:15 
QuestionKeyboard hook code explanation Pin
EvScott9-Apr-06 5:42
EvScott9-Apr-06 5:42 
AnswerRe: Keyboard hook code explanation Pin
David Crow10-Apr-06 3:32
David Crow10-Apr-06 3:32 
Questionstack trace Pin
LiYS9-Apr-06 4:17
LiYS9-Apr-06 4:17 
QuestionC++ ISO Compliance Pin
HalfWayMan9-Apr-06 4:11
HalfWayMan9-Apr-06 4:11 
AnswerRe: C++ ISO Compliance Pin
Hans9-Apr-06 7:03
Hans9-Apr-06 7:03 

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.