I believe I found a bug with TeeCreateMetaFile.
I have a TTree graphic and I am trying to get the image for a given area.
My bounds are TRec(0,0,2200,600);
I ask for TeeCreateMetaFile(True, 0,0,1100,600) {the first page} and it works great.
I ask for TCreateMetaFile(True, -1100,0,1100,600) {the second page} and the image is correct, but the proportions of the image are off. Width = 2200, height = 600.
I have the source and believe I found the bug in TeeProcs.TeeCreateMetaFile.
It is treating the Rect as a rectangle to calculate the Hight and Width.
result.Width :=Max(1,Rect.Right-Rect.Left);
result.Height:=Max(1,Rect.Bottom-Rect.Top);
Since Rect is a point with left and right being the width and height, I believe it should be the following.
result.Width :=Max(1,Rect.Right);
result.Height:=Max(1,Rect.Bottom);
I tried to test my changes, but when I run your TeeRecompile.exe I get the following error.
TeeChart Installation
VERSION: 7
D2006.Win32 v10 (update 2) (BDS v4 Professional)
EXCEPTION:
File not found
--------------------------------------------
EXCEPTION:
Operation aborted
--------------------------------------------
Could you please get me a fix for this.
Creating Meta File Bug
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Artimus,
If you are a sourcecode customer, have you tried using v7.12 which is latest version available at the client area?
If the problem still persists there, would you be so kind to arrange a simple example project we can run "as-is" to reproduce the problem here?
You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.
Thanks in advance.
If you are a sourcecode customer, have you tried using v7.12 which is latest version available at the client area?
If the problem still persists there, would you be so kind to arrange a simple example project we can run "as-is" to reproduce the problem here?
You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.
Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Version 7.12 has the same problem.
I got your TeeRecompile.exe to work with 7.12 and fixed the bug, and now it works.
I used your TeeChartOffice for a simple example. I put a button on the chart which tries to do some custom printing. It gave me more problems than my other project did, but I will let you figure out why all the pages don't print how they should.
If you look at the code for 2 seconds you will see the problem. As far as I can see a TRect is used as start point and then .Right as width and .Bottom as height. In TeeProcs TCustomTeePanel.TeeCreateMetafile it creates the picture width and height as .Right - .Left.
//TeeProcs line 1359
result.Width :=Max(1,Rect.Right-Rect.Left);
result.Height:=Max(1,Rect.Bottom-Rect.Top);
when .Right is already the width. So if your left is not 0 but negative, then it makes the picture width wider than it should be.
I got your TeeRecompile.exe to work with 7.12 and fixed the bug, and now it works.
I used your TeeChartOffice for a simple example. I put a button on the chart which tries to do some custom printing. It gave me more problems than my other project did, but I will let you figure out why all the pages don't print how they should.
If you look at the code for 2 seconds you will see the problem. As far as I can see a TRect is used as start point and then .Right as width and .Bottom as height. In TeeProcs TCustomTeePanel.TeeCreateMetafile it creates the picture width and height as .Right - .Left.
//TeeProcs line 1359
result.Width :=Max(1,Rect.Right-Rect.Left);
result.Height:=Max(1,Rect.Bottom-Rect.Top);
when .Right is already the width. So if your left is not 0 but negative, then it makes the picture width wider than it should be.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Artimus,
Thanks for the information. We could reproduce the issue here in v7 and added it (TV52013245) to the defect list to be investigated for next releases.
Thanks for the information. We could reproduce the issue here in v7 and added it (TV52013245) to the defect list to be investigated for next releases.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Artimus,
Since summer 2007 current TeeChart VCL version is v8 so it's most unlikely that any upgrade to v7 is made. We'll need to investigate the issue you posted in v8 and I can't give any estimation date at the moment.
Since summer 2007 current TeeChart VCL version is v8 so it's most unlikely that any upgrade to v7 is made. We'll need to investigate the issue you posted in v8 and I can't give any estimation date at the moment.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |