1

我正在尝试使用AggPas ,但发现文档缺少将其附加到位图的代码示例。

我有这个代码:

procedure DrawScene();
var
  ObjLength,LineLength,Filllength,Obj,lin,angle,i:integer;
  Npoints : array[0..1] of Tpoint;
  VG: Tagg2d;
  DOB:Tobject;
  Objmap,wholemap:TBitmap;
begin
  wholemap := TBitmap.Create;
  wholemap.PixelFormat:=pf32bit;
  VG := Tagg2d.create;
  if VG.attach(wholemap,False) then
  showmessage('true')
  else
  showmessage('false');
  wholemap.Width:=area;
  wholemap.height:=area;

但它返回错误,据我所知,我做对了。我肯定错过了什么。

4

1 回答 1

4

您必须在将 VG 附加到其上之前定义位图尺寸。此外,在您执行附加后不要更改位图尺寸,它可能会导致 AV(您必须在尺寸更改后进行新的附加以进行渲染)。

于 2010-07-18T09:41:56.107 回答