Helpful Information
 
 
Category: Delphi Programming
printing Kylix graphics pages

I'm developing Kylix GUIs that illustrate various configurations of our systems. I have nice pages filled with various components. How do I print these pretty graphics pages with the click of a button? Is there a utility within Kylix? So far, all I can find that's printable is the Canvas, but I'm not drawing on a Canvas. I want the entire GUI printed. How do I do it?:confused:

Dunno specifically about Kylix, but in my Delphi 6, the TForm component has a print method. All I did was this:


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

and it printed an image with all the components in my form. Hope this helps :)

Scorpions dude:

Thanks for the suggestion, but it doesn't appear to work for me. Maybe I'm missing something else that needs to be done, for example something in the uses clause, or some other code somewhere. Or maybe Kylix is different from Delphi. I basically taught myself Kylix and Object Pascal in order to write these GUIs, so please don't assume I know anything. Any other suggestions?

Kylix does definitively differ from Delphi.

Do your Controls have a PaintTo() method maybe? Also, in Delphi, a TForm has a GetFormImage() method, is this available?

I'm not sure how to see if PaintTo exists in the Controls. If I try Form1.Controls.PaintTo I get an error, but I've seen PaintTo in a list of TControlStyle types, but I don't know how to use that. I also do not find a GetFormImage method available on my form.

All I want to do is a bitmap dump of the form, with all visible components, to a postscript file. Then I could spawn a system command to print the postscript file. There must be a way to do this.










privacy (GDPR)