CopyToClipboardMetafile and Windows / Office versions

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
toreba
Newbie
Newbie
Posts: 17
Joined: Thu Aug 07, 2014 12:00 am

CopyToClipboardMetafile and Windows / Office versions

Post by toreba » Fri Jul 17, 2015 11:35 am

Hi,

On Windows 7, 32-bit or 64-bit, using TeeChart 2013 for RAD XE2, the TChart.CopyToClipboardMetafile as EMF creates an image about 70 times larger (in bytes) compared to Windows XP, 32-bit, using TeeChart 2012 for Delphi 2007. The image sizes are in this case 2Mb v30kb.

This means that Word documents embedding a lot of such images become massive. Do you know what's changed? EMF format? The TChart method? The Windows clipboard?

Thanks for any advice.

Regards

Toreba

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

Re: CopyToClipboardMetafile and Windows / Office versions

Post by Yeray » Fri Jul 17, 2015 1:37 pm

Hello Toreba,

I've run this code with all TeeChart version from v2012.05 to the actual version v2015.15 (and the current sources v2015.16).

Code: Select all

uses Series, TeeConst;

var Chart1: TChart;

procedure TForm1.FormCreate(Sender: TObject);
begin
  Chart1:=TChart.Create(Self);
  Chart1.Parent:=Self;
  Chart1.Title.Text.Text:=TeeMsg_Version;

  with Chart1.AddSeries(TBarSeries) as TBarSeries do
  begin
    FillSampleValues;
    ColorEachPoint:=true;
  end;

  //Chart1.CopyToClipboardMetafile(true);
  Chart1.SaveToMetafileEnh('E:\tmp\emfChart_v' + TeeProductName +
         TeeVCLMinorVersion + '.' + TeeVCLBuildVersion +'.emf');
end;
Find here all the emf files generated:
emfChart_from_v2012.05_to_v2015.16.zip
(138.11 KiB) Downloaded 534 times
As you can see, from v2013.09 there was an increment in sizes from about 30Kb to about 75Kb.
Note there's an exception, concretely at v2013.08, with about 370Kb. I'm not sure if this is the version where you observed the difference.

Also note, going back to GDI reduces the size of the emf files generated.
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

toreba
Newbie
Newbie
Posts: 17
Joined: Thu Aug 07, 2014 12:00 am

Re: CopyToClipboardMetafile and Windows / Office versions

Post by toreba » Thu Aug 13, 2015 11:34 am

Yeray,

Yes, that's exactly the version I was using, in XE2. I will upgrade to a later version.

Thank you very much for your help.

Regards

Toreba

toreba
Newbie
Newbie
Posts: 17
Joined: Thu Aug 07, 2014 12:00 am

Re: CopyToClipboardMetafile and Windows / Office versions

Post by toreba » Sat Aug 22, 2015 4:02 pm

Yeray,

I ported to TeeChart Pro 2014.12.140923 32-bit VCL, and this helped to an extent, though the files I was producing were still many times larger than they were with TeeChart 2012 for Delphi 2007. Switching back from GDI+ to GDI was much more effective, producing files of much more comparable size. So when did TChart switch to GDI+?

Thanks for your advice.

Toreba

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

Re: CopyToClipboardMetafile and Windows / Office versions

Post by Yeray » Mon Aug 24, 2015 9:26 am

Hi Toreba,
toreba wrote:So when did TChart switch to GDI+?
Yeray wrote:TeeChart 2013.09 moved the default Canvas from GDI to GDIPlus
http://www.teechart.net/support/viewtop ... 483#p66483
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