unit18.cpp

来自「VC做的图象处理软件」· C++ 代码 · 共 63 行

CPP
63
字号
//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "Unit18.h"
#include "Unit1.h"
#include "Unit3.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
extern TColor tGraphColor;          //图形颜色
extern TColor tBrushColor;         //填充颜色
extern TColor tGroundColor;       //背景色
TColor tForm18TempColor;
TForm18 *Form18;
//---------------------------------------------------------------------------
__fastcall TForm18::TForm18(TComponent* Owner)
        : TForm(Owner)
{
}
//---------------------------------------------------------------------------

void __fastcall TForm18::BitBtn2Click(TObject *Sender)
{
        this->Close();
}
//---------------------------------------------------------------------------

void __fastcall TForm18::FormShow(TObject *Sender)
{
        tForm18TempColor=Form3->Shape1->Brush->Color;
        Edit1->Text=IntToStr(GetRValue(tForm18TempColor));
        Edit2->Text=IntToStr(GetGValue(tForm18TempColor));
        Edit3->Text=IntToStr(GetBValue(tForm18TempColor));
        Shape1->Brush->Color=tForm18TempColor;
}
//---------------------------------------------------------------------------

void __fastcall TForm18::BitBtn1Click(TObject *Sender)
{
        tForm18TempColor=Shape1->Brush->Color;
        if(CheckBox1->Checked)
        {
                tGraphColor=tForm18TempColor;
                Form1->Shape1->Brush->Color=tForm18TempColor;
        }
        if(CheckBox2->Checked)
        {
                tBrushColor=tForm18TempColor;
                Form1->Shape2->Brush->Color=tForm18TempColor;
        }
        if(CheckBox3->Checked)
        {
                tGroundColor=tForm18TempColor;
                Form1->Shape3->Brush->Color=tForm18TempColor;
        }
        Form3->Shape1->Brush->Color=tForm18TempColor;
        Form1->StatusBar2->Panels->Items[1]->Text="RGB: ("+IntToStr(GetRValue(tForm18TempColor))+","+IntToStr(GetGValue(tForm18TempColor))+","+IntToStr(GetBValue(tForm18TempColor))+")";
}
//---------------------------------------------------------------------------

⌨️ 快捷键说明

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