Курсовая работа: Алгоритмы поиска кратчайших покрытий булевых матриц
void __fastcall TForm2::Image1MouseDown(TObject *Sender,
TMouseButton Button, TShiftState Shift, int X, int Y)
{
if(c==0)
{
X=X/10*10;
Y=Y/10*10;
if(Image1->Canvas->Pixels[X+5][Y+5]==clWhite)
{
arr[Y/10][X/10]=1;
arra[X/10]++;
arrb[Y/10]++;
Image1->Canvas->Brush->Color=clActiveCaption;
}
else
{
arr[Y/10][X/10]=0;
arra[X/10]--;
arrb[Y/10]--;
Image1->Canvas->Brush->Color=clWhite;
}
Image1->Canvas->FillRect(Rect(X+1,Y+1,X+10,Y+10));
}}
//---------------------------------------------------------------------------
void __fastcall TForm2::N5Click(TObject *Sender)
{
Form1->Close();
}
//---------------------------------------------------------------------------