We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you a podcast all about Citrix Workspace, moving to the cloud, and analytics & intelligence. Episode 2 coming soon!Listen Now

x

drawing not printed

thegroover
thegroover asked
on
Medium Priority
188 Views
Last Modified: 2010-04-05
Hi,
I have a form with some drawing on it (using LineTo();) and I'd like to print it, but when I call form1.print, I see just the empty form without the lines. Why is that and how can I resolve it?

thanks in advance
G
Comment
Watch Question

Hi, try use function
GetFormImage(): TBitmap;
to get form imege to TBitmap class, then print it.

Author

Commented:
didn't work, here is the source:

procedure TForm1.printfrm;
var FormImage: TBitmap;
begin
  FormImage:=GetFormImage;
  print;
end;
Now I see. You just must repaint all your lines in OnPaint event, like this:

procedure TForm1.Button2Click(Sender: TObject);
begin
    Print;
end;

procedure TForm1.FormPaint(Sender: TObject);
begin
    Canvas.MoveTo(0,0);
    Canvas.LineTo(100,100);
end;

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

Author

Commented:
this will do it, thanks
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.