//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "FloodFill.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
	: TForm(Owner)
{
}
//---------------------------------------------------------------------------
// BeginExample: FloodFill
// Method: Graphics.TCanvas.FloodFill

// BeginCode
/*
The following code floodfills from the center point of
Form1's client area until the color black is encountered:
*/
void __fastcall TForm1::Button1Click(TObject *Sender)
{
  Canvas->Brush->Color = clBlue;
  Canvas->Brush->Style = bsDiagCross;
  Canvas->FloodFill(
	ClientWidth/2, ClientHeight/2, clBlack, fsBorder);
}

void __fastcall TForm1::Button2Click(TObject *Sender)
{
  int ewidth = 400;
  int eheight = 200;
  Canvas->Brush->Color = clRed;
  Canvas->Pen->Color = clBlack;
  Canvas->Ellipse(
	(ClientWidth - ewidth)/2,
    (ClientHeight - eheight)/2, 
    ewidth, eheight);
}
// EndCode
// EndExample: FloodFill
//---------------------------------------------------------------------------

