我正在使用Delphi XE8
XIV IntraWeb
v14.0.49 我创建了一个TIWForm
并TChart
在其上放置了一个组件。
在设计时TChart
显示,我可以设置它。
但是在运行时TChart
网页上没有。
我应该配置任何设置来使用它吗?
看来您必须使用TChart
withTIWImage
才能在网页中显示它。
我在 IntraWeb 演示中找到了以下方法
// this method copies a TChart to an TIWImage
procedure CopyChartToImage(const aChart: TChart; const aImage: TIWImage);
var
xMetaFile: TMetafile;
xBitmap: TBitmap;
xRect: TRect;
begin
xBitmap := aImage.Picture.Bitmap;
xBitmap.Width := aChart.Width;
xBitmap.Height := aChart.Height;
aImage.Width := aChart.Width;
aImage.Height := aChart.Height;
xRect := Rect(0, 0, aChart.Width, aChart.Height);
aChart.BufferedDisplay := False;
xMetaFile := aChart.TeeCreateMetafile(False, xRect);
try
xBitmap.Canvas.Draw(0, 0, xMetaFile);
finally
FreeAndNil(xMetaFile);
end;
end;