⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 shiyan1.~cpp

📁 用C++builder编写的应用程序
💻 ~CPP
📖 第 1 页 / 共 2 页
字号:
//---------------------------------------------------------------------------

void __fastcall TForm1::Panel15MouseDown(TObject *Sender,
      TMouseButton Button, TShiftState Shift, int X, int Y)
{
     if (Button==mbLeft)
   Panel7->Color=Panel15->Color;
  else
    Panel6->Color=Panel15->Color;
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Panel13MouseDown(TObject *Sender,
      TMouseButton Button, TShiftState Shift, int X, int Y)
{   if (Button==mbLeft)
   Panel7->Color=Panel13->Color;
  else
    Panel6->Color=Panel13->Color;

}
//---------------------------------------------------------------------------

void __fastcall TForm1::Panel11MouseDown(TObject *Sender,
      TMouseButton Button, TShiftState Shift, int X, int Y)
{
     if (Button==mbLeft)
   Panel7->Color=Panel11->Color;
  else
    Panel6->Color=Panel11->Color;
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Panel22MouseDown(TObject *Sender,
      TMouseButton Button, TShiftState Shift, int X, int Y)
{
        if (Button==mbLeft)
   Panel7->Color=Panel22->Color;
  else
    Panel6->Color=Panel22->Color;
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Panel20MouseDown(TObject *Sender,
      TMouseButton Button, TShiftState Shift, int X, int Y)
{     if (Button==mbLeft)
   Panel7->Color=Panel20->Color;
  else
    Panel6->Color=Panel20->Color;

}
//---------------------------------------------------------------------------

void __fastcall TForm1::Panel18MouseDown(TObject *Sender,
      TMouseButton Button, TShiftState Shift, int X, int Y)
{
        if (Button==mbLeft)
   Panel7->Color=Panel18->Color;
  else
    Panel6->Color=Panel18->Color;
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Panel16MouseDown(TObject *Sender,
      TMouseButton Button, TShiftState Shift, int X, int Y)
{    if (Button==mbLeft)
   Panel7->Color=Panel16->Color;
  else
    Panel6->Color=Panel16->Color;

}
//---------------------------------------------------------------------------

void __fastcall TForm1::Panel26MouseDown(TObject *Sender,
      TMouseButton Button, TShiftState Shift, int X, int Y)
{  if (Button==mbLeft)
   Panel7->Color=Panel26->Color;
  else
    Panel6->Color=Panel26->Color;

}
//---------------------------------------------------------------------------

void __fastcall TForm1::Panel24MouseDown(TObject *Sender,
      TMouseButton Button, TShiftState Shift, int X, int Y)
{    if (Button==mbLeft)
   Panel7->Color=Panel24->Color;
  else
    Panel6->Color=Panel24->Color;

}
//---------------------------------------------------------------------------

void __fastcall TForm1::Panel32MouseDown(TObject *Sender,
      TMouseButton Button, TShiftState Shift, int X, int Y)
{
if (Button==mbLeft)
   Panel7->Color=Panel32->Color;
  else
    Panel6->Color=Panel32->Color;
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Panel30MouseDown(TObject *Sender,
      TMouseButton Button, TShiftState Shift, int X, int Y)
{
        if (Button==mbLeft)
   Panel7->Color=Panel30->Color;
  else
    Panel6->Color=Panel30->Color;
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Panel28MouseDown(TObject *Sender,
      TMouseButton Button, TShiftState Shift, int X, int Y)
{
       if (Button==mbLeft)
   Panel7->Color=Panel28->Color;
  else
    Panel6->Color=Panel28->Color;
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Panel35MouseDown(TObject *Sender,
      TMouseButton Button, TShiftState Shift, int X, int Y)
{   if (Button==mbLeft)
   Panel7->Color=Panel35->Color;
  else
    Panel6->Color=Panel35->Color;

}
//---------------------------------------------------------------------------

void __fastcall TForm1::Panel34MouseDown(TObject *Sender,
      TMouseButton Button, TShiftState Shift, int X, int Y)
{
           if (Button==mbLeft)
   Panel7->Color=Panel34->Color;
  else
    Panel6->Color=Panel34->Color;
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Panel36MouseDown(TObject *Sender,
      TMouseButton Button, TShiftState Shift, int X, int Y)
{        if (Button==mbLeft)
   Panel7->Color=Panel36->Color;
  else
    Panel6->Color=Panel36->Color;

}
//---------------------------------------------------------------------------

void __fastcall TForm1::Panel29MouseDown(TObject *Sender,
      TMouseButton Button, TShiftState Shift, int X, int Y)
{
         if (Button==mbLeft)
   Panel7->Color=Panel29->Color;
  else
    Panel6->Color=Panel29->Color;
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Panel31MouseDown(TObject *Sender,
      TMouseButton Button, TShiftState Shift, int X, int Y)
{
     if (Button==mbLeft)
   Panel7->Color=Panel31->Color;
  else
    Panel6->Color=Panel31->Color;
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Panel23MouseDown(TObject *Sender,
      TMouseButton Button, TShiftState Shift, int X, int Y)
{      if (Button==mbLeft)
   Panel7->Color=Panel23->Color;
  else
    Panel6->Color=Panel23->Color;

}
//---------------------------------------------------------------------------

void __fastcall TForm1::Panel25MouseDown(TObject *Sender,
      TMouseButton Button, TShiftState Shift, int X, int Y)
{          if (Button==mbLeft)
   Panel7->Color=Panel25->Color;
  else
    Panel6->Color=Panel25->Color;

}
//---------------------------------------------------------------------------

void __fastcall TForm1::Panel27MouseDown(TObject *Sender,
      TMouseButton Button, TShiftState Shift, int X, int Y)
{            if (Button==mbLeft)
   Panel7->Color=Panel27->Color;
  else
    Panel6->Color=Panel27->Color;

}
//---------------------------------------------------------------------------

void __fastcall TForm1::Panel17MouseDown(TObject *Sender,
      TMouseButton Button, TShiftState Shift, int X, int Y)
{
            if (Button==mbLeft)
   Panel7->Color=Panel17->Color;
  else
    Panel6->Color=Panel17->Color;
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Panel19MouseDown(TObject *Sender,
      TMouseButton Button, TShiftState Shift, int X, int Y)
{
          if (Button==mbLeft)
   Panel7->Color=Panel19->Color;
  else
    Panel6->Color=Panel19->Color;
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Panel21MouseDown(TObject *Sender,
      TMouseButton Button, TShiftState Shift, int X, int Y)
{
         if (Button==mbLeft)
   Panel7->Color=Panel21->Color;
  else
    Panel6->Color=Panel21->Color;
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Panel8MouseDown(TObject *Sender,
      TMouseButton Button, TShiftState Shift, int X, int Y)
{
              if (Button==mbLeft)
   Panel7->Color=Panel18->Color;
  else
    Panel6->Color=Panel18->Color;
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Panel12MouseDown(TObject *Sender,
      TMouseButton Button, TShiftState Shift, int X, int Y)
{
             if (Button==mbLeft)
   Panel7->Color=Panel12->Color;
  else
    Panel6->Color=Panel12->Color;
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Panel14MouseDown(TObject *Sender,
      TMouseButton Button, TShiftState Shift, int X, int Y)
{               if (Button==mbLeft)
   Panel7->Color=Panel14->Color;
  else
    Panel6->Color=Panel14->Color;

}
//---------------------------------------------------------------------------

void __fastcall TForm1::Panel9MouseDown(TObject *Sender,
      TMouseButton Button, TShiftState Shift, int X, int Y)
{
                if (Button==mbLeft)
   Panel7->Color=Panel9->Color;
  else
    Panel6->Color=Panel9->Color;
}
//---------------------------------------------------------------------------








void __fastcall TForm1::SpeedButton3Click(TObject *Sender)
{
   DrawingTool=dtErase;
}
//---------------------------------------------------------------------------

void __fastcall TForm1::SpeedButton4Click(TObject *Sender)
{   DrawingTool=dtFill;
       Edit1->Enabled=false;
         Edit1->Visible=false;       
}
//---------------------------------------------------------------------------

void __fastcall TForm1::SpeedButton10Click(TObject *Sender)
{    DrawingTool=dtText;
       Edit1->Clear();
       Edit1->Enabled=true;
        Edit1->Visible=true;
        FontDialog1->Execute() ;
       Image1->Canvas->Font =FontDialog1->Font ;


}
//---------------------------------------------------------------------------



void __fastcall TForm1::SpeedButton1Click(TObject *Sender)
{    Edit1->Enabled=false;
         Edit1->Visible=false;       

}
//---------------------------------------------------------------------------

void __fastcall TForm1::SpeedButton2Click(TObject *Sender)
{   DrawingTool=dtSelect;
     Edit1->Enabled=false;
         Edit1->Visible=false;       

}
//---------------------------------------------------------------------------

void __fastcall TForm1::SpeedButton5Click(TObject *Sender)
{    Edit1->Enabled=false;
         Edit1->Visible=false;
          DrawingTool=dtSoak;

}
//---------------------------------------------------------------------------

void __fastcall TForm1::SpeedButton9Click(TObject *Sender)
{
     Edit1->Enabled=false;
         Edit1->Visible=false;
        DrawingTool=dtFog;
}
//---------------------------------------------------------------------------

void __fastcall TForm1::SpeedButton12Click(TObject *Sender)
{     Edit1->Enabled=false;
         Edit1->Visible=false;       

}
//---------------------------------------------------------------------------

void __fastcall TForm1::SpeedButton14Click(TObject *Sender)
{

         DrawingTool=dtPoly;
        Edit1->Enabled=false;
        Edit1->Visible=false;
        //Image1->Canvas->Pen->Width =1;
        fp=true;
        np=true;

}
//---------------------------------------------------------------------------

void __fastcall TForm1::NCtrlN1Click(TObject *Sender)
{        Image1->Canvas->Brush->Color=clWhite ;
     Image1->Canvas->Brush->Style=bsSolid;
      Graphics::TBitmap *Bit=new Graphics::TBitmap();
        Bit->Width =StrToInt(512) ;
        Bit->Height=StrToInt(384) ;
        Form1->Image1->Top=0;
        Form1->Image1->Left=0;
        Form1->Image1->Picture->Graphic=Bit;
        Form1->Image1->Canvas->Draw(0, 0, Bit);

     //Image1->Canvas->Rectangle(0,0,Image1->Width,Image1->Height);
}
//---------------------------------------------------------------------------

void __fastcall TForm1::XAltF41Click(TObject *Sender)
{
     Close();     
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Image1DblClick(TObject *Sender)
{
    if(DrawingTool==dtPoly){
     
     Image1->Canvas->Pen->Mode=pmCopy;
     Image1->Canvas->MoveTo(Origin.x, Origin.y);
     Image1->Canvas->LineTo(PrePt.x ,PrePt.y);
      np=false;

     }
}
//---------------------------------------------------------------------------

void __fastcall TForm1::SpeedButton6Click(TObject *Sender)
{       Edit1->Enabled=false;
        Edit1->Visible=false;
        DrawingTool=dtmagnify;
}
//---------------------------------------------------------------------------






void __fastcall TForm1::N13Click(TObject *Sender)
{
   N13->Checked^=true;
        if(N13->Checked)
        FontDialog1->Execute();
        Image1->Canvas->Font=Form1->FontDialog1->Font;


}
//---------------------------------------------------------------------------

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -