我目前正在起草中的一些图像Tvirtualdrawtree
使用油漆前。 这里是我的绘制代码
procedure TForm2.VDTAniBeforeCellPaint(Sender: TBaseVirtualTree;
TargetCanvas: TCanvas; Node: PVirtualNode; Column: TColumnIndex;
CellPaintMode: TVTCellPaintMode; CellRect: TRect; var ContentRect: TRect);
var
Data: PAnimeData;
NewRect: TRect;
R: TRect;
begin
//
if not Assigned(Node) then
begin
exit;
end;
Data := VDTAni.GetNodeData(Node);
case Column of
0, 1 ,2, 3, 4, 5, 6, 7:
begin
TargetCanvas.Brush.Style := bsClear;
TargetCanvas.FillRect(CellRect);
NewRect := ContentRect;
NewRect.Left := NewRect.Left;
NewRect.Width := 55;
NewRect.Height := 55;
NewRect.Top := NewRect.Top + 2;
NewRect.Bottom := NewRect.Bottom;
if Column = 0 then
begin
with NewRect do
begin
TargetCanvas.StretchDraw( NewRect, Data.FObject.anmigraphic);
end;
end;
end;
绘制的图像来垂直。 我想向他们展示水平例如在这个下面的图片
下面是数据结构
type
TAnmiClass = class
private
Fanmigraphic : TGifImage;
public
property anmigraphic: TGifImage read Fanmigraphic write Fanmigraphic;
public
constructor Create;
destructor Destroy; override;
end;
type
PAnimeData = ^TAnimeData;
TAnimeData = record
FObject: TAnmiClass;
end;