Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to print out the drawing in dialog box ?

Status
Not open for further replies.

subang

Programmer
Jan 1, 2002
4
0
0
MY
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
::DeleteDC(hDC);
}

}
 
thanks u, jeffray !

how about if i want to see the drawing previews on the dialogbox first, then just print it out on paper through the printer ?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top