我正在尝试使用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;但是它返回了false,而且据我所知,我做的事情都是对的。我一定漏掉了什么。
发布于 2010-07-18 17:41:56
在将VG附加到位图尺寸之前,必须定义位图尺寸。此外,在执行附加之后,不要更改位图尺寸,这可能会导致AV (为了渲染目的,您必须在尺寸更改后执行新的附加操作)。
https://stackoverflow.com/questions/3273133
复制相似问题