0

我正在使用Delphi XE8XIV IntraWebv14.0.49 我创建了一个TIWFormTChart在其上放置了一个组件。

在设计时TChart显示,我可以设置它。

但是在运行时TChart网页上没有。

我应该配置任何设置来使用它吗?

4

1 回答 1

2

看来您必须使用TChartwithTIWImage才能在网页中显示它。

我在 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;

了解更多信息

于 2015-12-23T08:12:59.000 回答