i use "CDC" to draw somethings on my dialog box, now i wanna print out my drawing in paper through printer. Can anybody give me a help ? thank u !
With the program running, reach out to the top of your keyboard and press the "Print Screen" key. Then open paintbrush and paste the picture in. Go to the FILE menu and PRINT. Now wasn't that easy? ~~~~~~~~~~~~~~~~~~~~~~
Adam Horky
Sealevel Systems, Inc.
(864)843-4343
~~~~~~~~~~~~~~~~~~~~~~
sorry, atumbomb, what i means is i wanna know how to write the coding in vc++ to perform printing that drawing on paper, instead of using the manual way, cause i want to add a command button on the same screen as the drawing plan, and the function of that new command button is to print out what i draw in the dialog box.
CDlg::OnPrint()
{
CPrintDialog cPrint(FALSE);
// open the print dialog to select a printer
if (cPrint.DoModal() == IDOK)
{
HDC hDC = cPrint.GetPrinterDC();
if (hDC == NULL)return;
CDC *pDC = CDC::FromHandle(hDC);
// do your drawing here
:eleteDC(hDC);
}
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.