unit4.cpp

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

CPP
47
字号
//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "Unit4.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm4 *Form4;
extern float fWr,fWg,fWb;          
extern int iReturnValue;       
//---------------------------------------------------------------------------
__fastcall TForm4::TForm4(TComponent* Owner)
        : TForm(Owner)
{
}
//---------------------------------------------------------------------------

void __fastcall TForm4::BitBtn1Click(TObject *Sender)
{
        fWr=StrToFloat(MaskEdit1->Text);
        fWg=StrToFloat(MaskEdit2->Text);
        fWb=StrToFloat(MaskEdit3->Text);
        if((fWr+fWg+fWb)>1.01||(fWr+fWg+fWb)<0.99)
        {
                MessageBox(NULL,"错误,应符合此要求:Wr+Wg+Wb=1","error!",MB_OK);
        }
        else
        {
                iReturnValue=1;
                this->Close();
        }
}
//---------------------------------------------------------------------------
void __fastcall TForm4::FormShow(TObject *Sender)
{
        iReturnValue=0;
}
//---------------------------------------------------------------------------
void __fastcall TForm4::BitBtn2Click(TObject *Sender)
{
        this->Close();
}

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

⌨️ 快捷键说明

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