uses Direct2D, D2D1;
procedure TForm1.FormPaint(Sender: TObject);
var
cvs: TDirect2DCanvas;
R: TRect;
begin
cvs := TDirect2DCanvas.Create(Canvas, ClIEntRect);
cvs.BeginDraw;
cvs.Pen.Color := Color;
cvs.Brush.Color := clGreen;
R := Rect(30, 30, 200, 150);
cvs.Ellipse(R);
cvs.Brush.Handle.SetOpacity(0.75);
OffsetRect(R, 30, 20);
cvs.Ellipse(R);
cvs.Brush.Handle.SetOpacity(0.5);
OffsetRect(R, 30, 20);
cvs.Ellipse(R);
cvs.Brush.Handle.SetOpacity(0.25);
OffsetRect(R, 30, 20);
cvs.Ellipse(R);
cvs.EndDraw;
cvs.Free;
end;
效果圖: