Generated from the TEXTINCLUDE 2 resource. Microsoft Visual C++ generated resource script. LineTo(hdc, test_rect.right, test_rect.top) MoveToEx(hdc, test_rect.left, test_rect.bottom, NULL) LineTo(hdc, test_rect.right, test_rect.bottom) MoveToEx(hdc, test_rect.left, test_rect.top, NULL) Test_rect.bottom = height - test_rect.top įrameRect(hdc, &test_rect, stock_black_brush_handle) Test_rect.right = width - test_rect.left HPEN original_pen = (HPEN)SelectObject(hdc, stock_black_pen_handle) HBRUSH original_brush = (HBRUSH)SelectObject(hdc, stock_black_brush_handle) HPEN stock_black_pen_handle = (HPEN)GetStockObject(BLACK_PEN) HBRUSH stock_black_brush_handle = (HBRUSH)GetStockObject(BLACK_BRUSH) Void draw_image(HDC hdc, int width, int height) Y_pixels = GetDeviceCaps(printer_hdc, VERTRES) ĭraw_image(printer_hdc, x_pixels, y_pixels) X_pixels = GetDeviceCaps(printer_hdc, HORZRES) If(PrintDlgEx(print_dialog_struct_ptr) != S_OK)īool print_image(HDC printer_hdc, std::string *message_string_ptr) Print_dialog_struct_ptr->nStartPage = START_PAGE_GENERAL PD_NOPAGENUMS // Allows page ranges to be ignored. Print_dialog_struct_ptr->Flags = PD_ALLPAGES | Print_dialog_struct_ptr->hwndOwner = hwnd Print_dialog_struct_ptr->lStructSize = sizeof (PRINTDLGEX) Memset(print_dialog_struct_ptr, 0x00, sizeof (PRINTDLGEX)) Print_image(printer_hdc, message_string_ptr) īool select_printer(HWND hwnd, PRINTDLGEX *print_dialog_struct_ptr) If(!select_printer(hwnd, &print_dialog_struct)) Hinstance = HINSTANCE(GetWindowLongPtr(hwnd, GWLP_HINSTANCE)) Process_print_button(hdlg, &local_message_string) īool process_print_button(HWND hwnd, std::string *message_string_ptr) (DLGPROC)brush_printer_problem_dialog_box) īackground_brush_handle = (HBRUSH)GetStockObject(WHITE_BRUSH) ĭraw_image(hdc, dialog_rect.right - dialog_rect.left, Int WINAPI WinMain (HINSTANCE hinstance, HINSTANCE hPrevInstance, INT_PTR CALLBACK brush_printer_problem_dialog_box(HWND hdlg,īool process_print_button(HWND hwnd, std::string *message_string_ptr) īool select_printer(HWND hwnd, PRINTDLGEX *print_dialog_struct_ptr) īool print_cover_sheet(HDC printer_hdc, std::string *message_string_ptr) īool print_image(HDC printer_hdc, std::string *message_string_ptr) The project uses multi char rather than unicode. The printed page has all elements displayed as pail lines and curves. The XPS file has pail lines for 3 sides of the rectangle, and no visible line for the bottom of the rectangle. This function displays on the screen fine, but doesn't display properly for the printer. This sample program uses a function to display a simple collection of a rectangle, an ellipse and two lines. The app is over 100K lines in length, so I've duplicated the problem with a small program. My client reports the same problem with his printed report. The printed report has the text displayed fine, but the rectangles and circles are pail, almost invisible.įor this application, printing to an XPS file, and displaying that file, shows everything properly printed, and printing that XPS file prints text, rectangles and circles properly. The report also uses several circles, drawn with Arc(). Several rectangles, drawn with FrameRect(), indicate that different text is grouped together. I have a large app that uses the same function to display the contents of a report on the screen's HDC and the printer's HDC, using GDI. Developing 32 bit app on Win 7 Ultra 64, VS 2010 Pro, C++, Win32, no MFC.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |