Hello!
I was testing the TeeChart Pro 7.01 VCL / CLX version with Delphi 2005.
(WindowsXP) when I discover two bug with TColorGridSeries.
1.*************************************************
When a chart contains several TColorGridSeries with X and Z values, which values start not from 0 but from greater positive values, zooming sometimes causes "scan line out of index". I checked the source code in in the module "teesurf.pas" around a line 3950 found these expressions:
if tmpBounds.Left<1 then tmpBounds.Left:=1;
if tmpBounds.Top<1 then tmpBounds.Top:=1;
However, the next two lines :
if tmpBounds.Right>NumXValues then tmpBounds.Right:=NumXValues;
if tmpBounds.Bottom>NumZValues then tmpBounds.Bottom:=NumZValues;
reveals the next problem:
in some cases a zoom rectange, tmpBounds, greater then 0, for all bounds. For example (L:50,T:50)(R:100,B:100). Suppose we have a ColorGrid with 10x10 size. tmpBounds .Right and Bottom will be forced to limited by 10 and 10. But tmpBound.Left and Top are still 50,50 in this case bacause they are greater then 1 (see a line 3950).
Therefore, tmpBounds gets incorrect and reversible values, which, probably, causes this "scanline" error .
So, I changed the first two lines as following:
if tmpBounds.Left<Round(MinXValue) then tmpBounds.Left:=1;
if tmpBounds.Top<Round(MinZValue) then tmpBounds.Top:=1;
Till now, it works fine for my application.
****************************************
2
*******************************************
I noted, that if I set the SmoothBitmap property in True, sometimes,
during zooming, my example program (similar to above) gives on memory exception. I found that it occurs when I make a zooming rectangle, which catchs 2!! horizontal lines only from any colorgrid.
Going deeper I found the line 7679 in TeCanvas.pas where the error occurs.
{$IFDEF USE_SCANLINE}
with PColorRGB(Integer(SourceLine)+pixel*Delta)^ do
temporally I changed it to
{$IFDEF USE_SCANLINE}
with PColorRGB(Integer(SourceLine)+(pixel-1)*Delta)^ do
but it, definitly, not a good solution, because causes the same error for
the last line of TColorGrid now. However, it is passing normally the 2 lines case above.
*******************************************
Sincerely yours, Ilia.