I have a program for data acquisition and process control. I use TeeChart for real time plotting of data. I also have a legend window on top of the chart. I can print or save to disk the TeeChart, but would prefer to print/save the entire screen including the legend window. This is written in Delphi 7. I have tried several suggestions from other websites, but the us keybd_event procedures that are, apparently, not supported in Delphi 7. I could require the user to use the Print Screen key, but would prefer to use the button on the plot so I can remove the control buttons for the print function and then restore them after the screen is plotted. Any suggestions will be greatly welcomed. Thanks.

Recommended Answers

All 3 Replies

Have you tried copying the canvas of the form containing the TeeChart to the printer's canvas?

Have you tried copying the canvas of the form containing the TeeChart to the printer's canvas?

No, I haven't tried that and am not sure how to do it. I will look into that as a possibility, but it will be treading new ground for me. Thanks for the suggestion, I'll see what I can do.

TRCSr

It would look something like this

Printer.Canvas.CopyRect(PrtRect, Form.Canvas, FormRect);

PrtRect and FormRect are TRect.
FormRect defines the area of the Form that you want printed.
PrtRect defines where an the page the Form image goes.

Learning to control the printed page at this level is actually a lot of fun.

Best wisshes to you.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.