missing borders when copied and pasted

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
PKH
Newbie
Newbie
Posts: 3
Joined: Mon Jan 09, 2017 12:00 am

missing borders when copied and pasted

Post by PKH » Mon May 08, 2017 6:37 pm

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?

Yeray
Site Admin
Site Admin
Posts: 9614
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: missing borders when copied and pasted

Post by Yeray » Tue May 09, 2017 7:11 am

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.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Yeray
Site Admin
Site Admin
Posts: 9614
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: missing borders when copied and pasted

Post by Yeray » Tue May 09, 2017 7:37 am

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
soffice.bin_2017-05-09_09-36-34.png (5.88 KiB) Viewed 10062 times
I'm using TeeChart v2017.21. What version are you using?
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

PKH
Newbie
Newbie
Posts: 3
Joined: Mon Jan 09, 2017 12:00 am

Re: missing borders when copied and pasted

Post by PKH » Tue May 09, 2017 1:12 pm

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.
Attachments
GraphBorderIssue.zip
(65.36 KiB) Downloaded 558 times

Yeray
Site Admin
Site Admin
Posts: 9614
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: missing borders when copied and pasted

Post by Yeray » Tue May 09, 2017 2:03 pm

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;
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

PKH
Newbie
Newbie
Posts: 3
Joined: Mon Jan 09, 2017 12:00 am

Re: missing borders when copied and pasted

Post by PKH » Tue May 09, 2017 6:52 pm

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?

Yeray
Site Admin
Site Admin
Posts: 9614
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: missing borders when copied and pasted

Post by Yeray » Wed May 10, 2017 11:08 am

Hello,

Here the project modified to check GDI and GDIPlus:
GraphBorderIssue.zip
(2.09 KiB) Downloaded 603 times
This is what I get with v2017.21 using a border width of 1:
soffice.bin_2017-05-10_13-04-54.png
soffice.bin_2017-05-10_13-04-54.png (9.59 KiB) Viewed 10057 times
Don't you get the same?
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply