Off-screen bitmap drawing while printing and print previewing
-
I am developing a WYSIWYG MDI interface. The graphics look good on screen, now I am venturing into getting the print preview and printed version looking good. All of my drawing code in the CScrollView::OnDraw method. I am using an off-screen bitmap to draw into and at the end of the function I blt it into the CDC. Here are some of my questins: - Will the the off-screen approach work for print preview and printing? - If this is not the way to do print and print preview, the other problem I have is that some of the graphics I draw are transparent. I draw them by blting with SRCINVERT, SRCAND, SRCINVERT rop codes. Can this be done with 'print' DCs? Thanks for any help with printing. Craig Smith
-
I am developing a WYSIWYG MDI interface. The graphics look good on screen, now I am venturing into getting the print preview and printed version looking good. All of my drawing code in the CScrollView::OnDraw method. I am using an off-screen bitmap to draw into and at the end of the function I blt it into the CDC. Here are some of my questins: - Will the the off-screen approach work for print preview and printing? - If this is not the way to do print and print preview, the other problem I have is that some of the graphics I draw are transparent. I draw them by blting with SRCINVERT, SRCAND, SRCINVERT rop codes. Can this be done with 'print' DCs? Thanks for any help with printing. Craig Smith
cdsmith wrote: Will the the off-screen approach work for print preview and printing? yep cdsmith wrote: Can this be done with 'print' DCs? i've heard that the typical transparent-blt techniques don't work with printer DCs; and my experience agrees. but, you might get lucky and find a printer driver that can handle it. -c
When history comes, it always takes you by surprise.
-
I am developing a WYSIWYG MDI interface. The graphics look good on screen, now I am venturing into getting the print preview and printed version looking good. All of my drawing code in the CScrollView::OnDraw method. I am using an off-screen bitmap to draw into and at the end of the function I blt it into the CDC. Here are some of my questins: - Will the the off-screen approach work for print preview and printing? - If this is not the way to do print and print preview, the other problem I have is that some of the graphics I draw are transparent. I draw them by blting with SRCINVERT, SRCAND, SRCINVERT rop codes. Can this be done with 'print' DCs? Thanks for any help with printing. Craig Smith
cdsmith wrote: - Will the the off-screen approach work for print preview and printing? It should do, but it may be possible that you could hit an upper limit on the size of the bitmap. As some printers work in very large resolutions (3000 by 3000 or larger), this can cause a very large bitmap to be created. I think there was some upper limit on the size in earlier versions of windows (9x) cdsmith wrote: the other problem I have is that some of the graphics I draw are transparent In my experience, BitBlt works ok for the preview by does not produce output in the actual print for most printers. As you cannot guarantee what printer your user may have, I would suggest moving to the more generic StretchDIBBits() function which I haver never known not to work on a printer. The only issue you may have is that StretchDIBBits() may not support your transparanecy stuff. As I have never used it for that, you will have to investigate using the documentation. Hope it works out for you. Printing can be hard work. Roger Allen Sonork 100.10016 Were you different as a kid? Did you ever say "Ooohhh, shiny red" even once? - Paul Watson 11-February-2003