In my program each chart has a "visible" border, with no bevels (chart/Panel/Borders/Border and /Bevels). I let the user copy a graph (for pasting into another document) using the following code:
chart1.CopyToClipboardMetafile(true);
However, the chart when pasted into a document has a border on only the bottom and right sides, not all four sides.
I recently upgraded to Berlin and the newest TeeChart. The same code when compiled using Delphi XE and an older version of TeeChart results in a chart (when pasted into a document) that has a border on all four sides.
Any suggestions?
missing borders when copied and pasted
Re: missing borders when copied and pasted
Hello,
Do you know what was the old "working" version. It could help us to find where the change was and why.PKH wrote: The same code when compiled using Delphi XE and an older version of TeeChart results in a chart (when pasted into a document) that has a border on all four sides.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: missing borders when copied and pasted
Hello,
I've just tested it with a new simple example project with just a TChart on a Form and a Button:
After clicking the button, I can paste the chart in a paint and in a Word/Writer document and I see the 4 borders:
I'm using TeeChart v2017.21. What version are you using?
I've just tested it with a new simple example project with just a TChart on a Form and a Button:
Code: Select all
procedure TForm1.FormCreate(Sender: TObject);
begin
Chart1.View3D:=False;
Chart1.Border.Visible:=True;
Chart1.Border.Width:=4;
Chart1.BevelOuter:=bvNone;
Chart1.BevelInner:=bvNone;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
Chart1.CopyToClipboardMetafile(True);
end;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: missing borders when copied and pasted
Thanks for the response. I am using Delphi Berlin 10.1 and TeeChart Pro v2016.19.161025.
Yes, if I increase the border width to 4 the copied and pasted chart does have four borders. But with lower border widths there are issues. I attached a zip file with a Delphi project to demonstrate.
In the program you can select the border width from 0 to 4. In the program, there clearly visible differences in the left and top borders versus the bottom and right borders. (Bevels are turned off.)
When you copy a chart with borderwidth=1 into Word or Powerpoint there is a border when the image is small, but the the left and top border disappear when the image is enlarged. I suspect that this effect has something to do with pixels, display resolution setting, and the particular program the image is pasted into.
For me, I must set the the borderwidth to 2 to get a border in the pasted image close to what I want.
Thanks again for your help.
Yes, if I increase the border width to 4 the copied and pasted chart does have four borders. But with lower border widths there are issues. I attached a zip file with a Delphi project to demonstrate.
In the program you can select the border width from 0 to 4. In the program, there clearly visible differences in the left and top borders versus the bottom and right borders. (Bevels are turned off.)
When you copy a chart with borderwidth=1 into Word or Powerpoint there is a border when the image is small, but the the left and top border disappear when the image is enlarged. I suspect that this effect has something to do with pixels, display resolution setting, and the particular program the image is pasted into.
For me, I must set the the borderwidth to 2 to get a border in the pasted image close to what I want.
Thanks again for your help.
- Attachments
-
- GraphBorderIssue.zip
- (65.36 KiB) Downloaded 555 times
Re: missing borders when copied and pasted
Hello,
Note the default canvas moved to GDIPlus in newer versions. You can move back to GDI with:
I've checked it with old versions and I always got the same result. However, GDI vs GDIPlus seems to make a difference here.Yeray wrote:Do you know what was the old "working" version. It could help us to find where the change was and why.PKH wrote: The same code when compiled using Delphi XE and an older version of TeeChart results in a chart (when pasted into a document) that has a border on all four sides.
Note the default canvas moved to GDIPlus in newer versions. You can move back to GDI with:
Code: Select all
uses TeCanvas;
//...
Chart1.Canvas:=TTeeCanvas3D.Create;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: missing borders when copied and pasted
I have both gdiplus.dll and qtintf70.dll in the same directory as the exe. I also include both when users download / install my software.
However, I notice no difference with gdi+ or without gdi+ in my test program. Should I continue to include gdi+ with my software?
However, I notice no difference with gdi+ or without gdi+ in my test program. Should I continue to include gdi+ with my software?
Re: missing borders when copied and pasted
Hello,
Here the project modified to check GDI and GDIPlus: This is what I get with v2017.21 using a border width of 1: Don't you get the same?
Here the project modified to check GDI and GDIPlus: This is what I get with v2017.21 using a border width of 1: Don't you get the same?
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |