?
Solved

drawing not printed

Posted on 2006-04-06
4
Medium Priority
?
163 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
0
Comment
Question by:thegroover
  • 2
  • 2
4 Comments
 
LVL 1

Expert Comment

by:ArhiCoder
ID: 16399098
Hi, try use function
GetFormImage(): TBitmap;
to get form imege to TBitmap class, then print it.
0
 
LVL 1

Author Comment

by:thegroover
ID: 16399340
didn't work, here is the source:

procedure TForm1.printfrm;
var FormImage: TBitmap;
begin
  FormImage:=GetFormImage;
  print;
end;
0
 
LVL 1

Accepted Solution

by:
ArhiCoder earned 120 total points
ID: 16399530
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;
0
 
LVL 1

Author Comment

by:thegroover
ID: 16399552
this will do it, thanks
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Screencast - Getting to Know the Pipeline
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses
Course of the Month16 days, 19 hours left to enroll

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question