jaydeep
asked on
Device context of dialogbox
i want to use graphic gunction line recrcangle /LineTO/MoveTo on dialog box.
i don't know how to get dc of that & where to write code ?
i don't know how to get dc of that & where to write code ?
Hi,
We can use CClientDC as
CClientDC dc(this);
dc.MoveTo(10,10);
dc.LineTo(100,100);
Try it out.
VinExpert
We can use CClientDC as
CClientDC dc(this);
dc.MoveTo(10,10);
dc.LineTo(100,100);
Try it out.
VinExpert
ASKER
Hello mikeblas & vinexpert
you can't add WM_PAINT handler to CDialog class.there is WM_CTLCOLOR handler which is for controls.you can't draw on dialog box.
Also by declaring object of CClientDC
it doesn't work .
i have tried it.
you can't add WM_PAINT handler to CDialog class.there is WM_CTLCOLOR handler which is for controls.you can't draw on dialog box.
Also by declaring object of CClientDC
it doesn't work .
i have tried it.
ASKER
Hello mikeblas & vinexpert
you can't add WM_PAINT handler to CDialog class.there is WM_CTLCOLOR handler which is for controls.you can't draw on dialog box.
Also by declaring object of CClientDC
it doesn't work .
i have tried it.
you can't add WM_PAINT handler to CDialog class.there is WM_CTLCOLOR handler which is for controls.you can't draw on dialog box.
Also by declaring object of CClientDC
it doesn't work .
i have tried it.
Hi,
I was able to draw the line on the dialog's client area by using
CClientDC dc(this);
dc.MoveTo(10,10);
dc.LineTo(100,100);
Try it out.
VinExpert
I was able to draw the line on the dialog's client area by using
CClientDC dc(this);
dc.MoveTo(10,10);
dc.LineTo(100,100);
Try it out.
VinExpert
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Why a "B" and not an "A"? What more information did you need?
..B ekiM
..B ekiM
In that handler, create a local instance of CPaintDC. Use the CPaintDC for your painting.
..B ekiM