After creating a printer DC in your printing function calculate desired destination rectangle taking into account a size of paper: CSize paper_res; paper_res.cx = dcPrinter.GetDeviceCaps(HORZRES); paper_res.cy = dcPrinter.GetDeviceCaps(VERTRES); Try to set dcPrinter's map mode as MM_TEXT and to use dcPrinter.StrechBlt(...)
A
Alex Dolpfin
@Alex Dolpfin
Posts
-
Printing size -bmp-help needed! -
Simulating a disk file with a memory file?Try to use CMemFile MFC class.
-
1 day only! I will answer your beginner home-work assignments!What fun!!! :(
-
StretchDIBits fit into paper10th parameter of StretchDIBits should be a pointer to a buffer containing RGB data of bitmap you want to print. For eg. CBitmap bmp; bmp.LoadBitmap(IDB_SOMEBITMAP); BITMAP bm; bmp.GetBitmap(&bm); bm.bmBits is the pointer you need. Other parameters may be right or wrong cause I dont know what they mean in your program. By the way, for printing a bitmap you should to create a printer DC and to calculate destination rectangle with paper resolution. For more info see MSDN!