Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

printing the contents of a tpaintbox

Options
  • 23-04-2003 4:38pm
    #1
    Registered Users Posts: 2,593 ✭✭✭


    hi does any body out there know of a way to proint the contents of a tpaintbox so far this is what i have

    TPrinter *Prntr = Printer();
    Prntr->BeginDoc();
    mainFrame->Canvas;
    Prntr->EndDoc();

    but the printer keeps throwing out blank pages???


Comments

  • Registered Users Posts: 2,149 ✭✭✭dazberry


    You need to copy the contents of the paintbox canvas to the printer canvas.
    There are however a few problems.

    [1] TPaintbox does not store an image - hence the onpaint method. As a result you can't copy from a TPaintBox to another canvas.
    [2] Assuming you overcome [1], you will have scaling problems, because the printer canvas is a lot larger than the on screen canvas, so although things will appear fine onscreen, they'll be tiny on a printed page.

    TPrinter *Prntr = Printer();
    Prntr->BeginDoc();
    //mainFrame->Canvas;
    Prntr->Canvas->CopyRect(...)
    Prntr->EndDoc();

    Hint: Take a look at StretchBlt :D

    D.


Advertisement