GdiPlus[28]: IGPPen: 建立复合画笔


设置画笔的 CompoundArray 属性可得到复合画笔.

它对应的类型是 IGPCompoundArray (IGPCompoundArray = IGPArray<Single>).

如果复合画笔是 X 条线, 则数组需要 2*X 个元素; 元素从外向里分别表示线的起点和终点的比例值.

GdiPlus[28]: IGPPen: 建立复合画笔


uses GdiPlus;



procedure TForm1.FormPaint(Sender: TObject);

var

  Graphics: IGPGraphics;

  Pen: IGPPen;

  Rect: TGPRect;

  CompoundArr: IGPCompoundArray;

begin

  Graphics := TGPGraphics.Create(Handle);

  Rect.Initialize(20, 20, 200, 100);

  Pen := TGPPen.Create($FFFF0000, 10);



  CompoundArr := TGPArray<Single>.Create(4);

  CompoundArr[0] := 0;

  CompoundArr[1] := 0.5;

  CompoundArr[2] := 0.9;

  CompoundArr[3] := 1;



  Pen.CompoundArray := CompoundArr;

  Graphics.DrawEllipse(Pen, Rect);

end;


 
   

你可能感兴趣的:(dip)