Intraweb 8 and TChart Pro
Posted: Mon Aug 28, 2006 9:07 pm
In IWCompTeeChart.pas (which I believe compiles to make the IWChart compiled component) the following code (and comment) exists. I have
TChart 7 pro. Projects work OK when just using fpicture.assign(tmp).
However, when I follow the suggestion in the comment and change this to do a picture.assign(FChart) I get an exception and a Parent form does not exist error.
So, what is the meaning of the comment below? Is there any advantage to being able to assign FChart instead of a bitmap?
Function TIWChart.RenderHTML(AContext:
TIWBaseHTMLComponentContext):TIWHTMLTag;
var tmp : TBitmap;
begin
if Assigned(FChart) then
with FChart do
begin
FPicture.Bitmap.Width:=Width;
FPicture.Bitmap.Height:=Height;
tmp:=TeeCreateBitmap(Color,Rect(0,0,Width,Height));
try
// For compatibility with TeeChart Standard.
// With TeeChart Pro, simple FPicture.Assign(FChart), no bitmap
needed.
FPicture.Assign(tmp);
finally
tmp.Free;
end;
end;
result:=inherited RenderHTML(AContext);
end;
TChart 7 pro. Projects work OK when just using fpicture.assign(tmp).
However, when I follow the suggestion in the comment and change this to do a picture.assign(FChart) I get an exception and a Parent form does not exist error.
So, what is the meaning of the comment below? Is there any advantage to being able to assign FChart instead of a bitmap?
Function TIWChart.RenderHTML(AContext:
TIWBaseHTMLComponentContext):TIWHTMLTag;
var tmp : TBitmap;
begin
if Assigned(FChart) then
with FChart do
begin
FPicture.Bitmap.Width:=Width;
FPicture.Bitmap.Height:=Height;
tmp:=TeeCreateBitmap(Color,Rect(0,0,Width,Height));
try
// For compatibility with TeeChart Standard.
// With TeeChart Pro, simple FPicture.Assign(FChart), no bitmap
needed.
FPicture.Assign(tmp);
finally
tmp.Free;
end;
end;
result:=inherited RenderHTML(AContext);
end;