TImageCanvas (C++)

From RAD Studio Code Examples
Jump to: navigation, search

Description

The following example paints a cross-hatched ellipse onto Image1, which is a TImage on the form when you click Button1.

Code

void __fastcall TForm1::Button1Click(TObject *Sender)
{
  TCanvas *pCanvas = Image1->Canvas;
  pCanvas->Brush->Color = clRed;
  pCanvas->Brush->Style = bsDiagCross;
  pCanvas->Ellipse(0, 0, Image1->Width, Image1->Height);
}

Uses