unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls;
type
TForm1 = class(TForm)
Image1: TImage;
Label1: TLabel;
procedure FormCreate(Sender: TObject);
procedure Image1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
with image1.Canvas do
begin
pen.Color := clBlack;
brush.Color := clRed;
moveTo(200,50);
lineTo(200, 350);
moveTo(50,200);
LineTo(350, 200);
moveTo(200,60);
lineTo(340,200);
lineTo(200,340);
arc(60,60,340,340,200,50,201,350);
floodFill(199,199, clBlack, fsBorder);
floodFill(201,199, clBlack, fsBorder);
floodFill(199,201, clBlack, fsBorder);
floodFill(201,201, clBlack, fsBorder);
textout(190,205,'0');
textout(70,205,'-1');
textout(307,205,'1');
textout(190,65,'1');
textout(190,315,'-1');
end;
end;
procedure TForm1.Image1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
if (x<0) and (x*x+y*y<?)or (x>0) and ((x+y)<?) then
form1.Label1.Caption:='Принадлежит' else
form1.Label1.Caption:='Не принадлежит';
end;
end.
Никак не могу понять с чем нужно сравнивать...заранее спасибо.