using tcustomform.print

This is very sad. All I want to do is print the form out.
help says that
will do it by getting a bmp image of the form and feeding it to the printer.
Fine. That's what I want. A nice simple print of the form.
But blank paper keeps coming out. (I've checked the ink <g>)
My form has panels and captions and a bmp background, but simply
putting a label on and using 'print ;' doesn't work.
I've tried 'form1.print ;' but still the same result.
What am I doing wrong?

what is the easiest way to print my form. I thought this was it!
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

SRect,DRect: TRect; // Source Destination Rectangle
Tmp : TPicture;
// Initialize the rectangles
Tmp.Bitmap.Canvas.copyrect( dRect, Form1.Canvas,SRect);
assign it to image1
Print the Bitmap with
Printer.Canvas.StretchDraw(dRect, Image1.Picture.Graphic);
i think you have to use after begin
Tmp :=TPicture.Create;
and in the end;

>>assign it to image1
and use
for printing
Are you sure that you're getting nothing? You might be getting a very small image printed on the page. The Print method does no scaling at all, it just takes the form's image and throws it at the printer. It might be huge, it might be a postage stamp.
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

I tried this, with a button on a blank form, and it printed out fine.  Looking in the help, though, I see a direction.  The print method uses the GetFormImage method.  You can use the GetFormImage method and put the bitmap to a file or the clipboard, and see if DrDelphi is right (scaling problem), or something else (printer driver).

On second thought, looking more closely at the source of TCustomForm.Print, if DrDelphi is right, set the PrintScale method to poPrintToFit, and that will either fix your problem or eliminate one more idea.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
chriswoodAuthor Commented:
thanks to you 3. Actually sburck's comment helped me solve this. He confirmed that it should simply work! I tried with a different printer and it worked first time. I don't know what's wrong with my Hp laserjet 4000 but it was the printer not my programming...

But I would have gone round in circles without that... thanks again,
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.