Page 1 of 1
missing borders when copied and pasted
Posted: Mon May 08, 2017 6:37 pm
by 16479885
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?
Re: missing borders when copied and pasted
Posted: Tue May 09, 2017 7:11 am
by yeray
Hello,
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.
Do you know what was the old "working" version. It could help us to find where the change was and why.
Re: missing borders when copied and pasted
Posted: Tue May 09, 2017 7:37 am
by yeray
Hello,
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;
After clicking the button, I can paste the chart in a paint and in a Word/Writer document and I see the 4 borders:
- soffice.bin_2017-05-09_09-36-34.png (5.88 KiB) Viewed 10066 times
I'm using TeeChart v2017.21. What version are you using?
Re: missing borders when copied and pasted
Posted: Tue May 09, 2017 1:12 pm
by 16479885
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.
Re: missing borders when copied and pasted
Posted: Tue May 09, 2017 2:03 pm
by yeray
Hello,
Yeray wrote:
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.
Do you know what was the old "working" version. It could help us to find where the change was and why.
I've checked it with old versions and I always got the same result. However, GDI vs GDIPlus seems to make a difference here.
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;
Re: missing borders when copied and pasted
Posted: Tue May 09, 2017 6:52 pm
by 16479885
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?
Re: missing borders when copied and pasted
Posted: Wed May 10, 2017 11:08 am
by yeray
Hello,
Here the project modified to check GDI and GDIPlus:
This is what I get with v2017.21 using a border width of 1:
- soffice.bin_2017-05-10_13-04-54.png (9.59 KiB) Viewed 10061 times
Don't you get the same?