Creating Meta File Bug
Posted: Mon Jul 07, 2008 10:33 pm
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.
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.