c++ builder firemonkey 实现填充椭圆

相信同类Delphi 类似文章非常多了,这里我用c++ builder firemonkey 实现填充椭圆

本例主要在FormPaint实现,当然你想在Image1->Bitmap->Canvas这种地方也能够,详细看官方演示样例吧。

void __fastcall TForm3::FormPaint(TObject *Sender, TCanvas *Canvas, const TRectF &ARect)

{
Canvas->BeginScene();
System::Types::TRectF* Rect=new System::Types::TRectF(0,0,100,100);

 TRectF MyRect(50, 40, 200, 270);

 TAlphaColorRec*  mycolorRec=new TAlphaColorRec();
 mycolorRec->R=160;
 mycolorRec->G=60;
 mycolorRec->B=60;
 mycolorRec->A=255;
 System::Uitypes::TAlphaColor mycolor(mycolorRec->Color);

 TStrokeBrush* brush=new TStrokeBrush(TBrushKind::Solid, mycolor);
 Canvas->DrawEllipse(*Rect,90,brush);
 Canvas->FillEllipse(MyRect, 40,brush);
 Canvas->EndScene();
}

原文地址:https://www.cnblogs.com/llguanli/p/7125128.html