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;


效果图:



posted on 2011-04-01 13:10  万一  阅读(2617)  评论(0编辑  收藏  举报