unit15.cpp

来自「毕业设计图像处理软件及源代码对毕业生会有所帮助」· C++ 代码 · 共 52 行

CPP
52
字号
//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "Unit15.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
extern int iNewWidth,iNewHeight;       //新建画布宽和高
extern TColor tGroundColor;       //背景色
extern int iReturnValue;            //取值窗口返回值
TForm15 *Form15;
//---------------------------------------------------------------------------
__fastcall TForm15::TForm15(TComponent* Owner)
        : TForm(Owner)
{
}
//---------------------------------------------------------------------------

void __fastcall TForm15::FormShow(TObject *Sender)
{
        Shape1->Brush->Color=tGroundColor;
        iReturnValue=0;
}
//---------------------------------------------------------------------------
void __fastcall TForm15::Button3Click(TObject *Sender)
{
        this->Close();
}
//---------------------------------------------------------------------------
void __fastcall TForm15::Button2Click(TObject *Sender)
{
        iNewWidth=StrToInt(Edit1->Text);
        iNewHeight=StrToInt(Edit2->Text);
        if(iNewWidth<1||iNewWidth>1000||iNewHeight<1||iNewHeight>1000)
        {
                MessageBox(NULL,"宽高设置不正确,请重设,保证在1到1000之间","错误",MB_OK);
                return;
        }
        iReturnValue=1;
        tGroundColor=Shape1->Brush->Color;
        this->Close();
}
//---------------------------------------------------------------------------
void __fastcall TForm15::Button1Click(TObject *Sender)
{
        if (ColorDialog1->Execute())
                Shape1->Brush->Color=ColorDialog1->Color;
}
//---------------------------------------------------------------------------

⌨️ 快捷键说明

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