- //---------------------------------------------------------------------------
-
- #include <vcl.h>
- #pragma hdrstop
-
- #include "Unit1.h"
- #include "fstream.h"
-
- //---------------------------------------------------------------------------
- #pragma package(smart_init)
- #pragma resource "*.dfm"
- TForm1 *Form1;
- //---------------------------------------------------------------------------
- __fastcall TForm1::TForm1(TComponent* Owner)
- : TForm(Owner)
- {
- }
- //---------------------------------------------------------------------------
-
- void __fastcall TForm1::FormCreate(TObject *Sender)
- {
- R->Min = 0;
- R->Max = 255;
-
- G->Min = 0;
- G->Max = 255;
-
- B->Min = 0;
- B->Max = 255;
- }
- //---------------------------------------------------------------------------
-
- void __fastcall TForm1::ShowColor()
- {
- Shape1->Brush->Color = RGB(R->Position,
- G->Position,
- B->Position );
- }
-
- void __fastcall TForm1::RChange(TObject *Sender)
- {
- ShowColor();
- iR->Caption = R->Position;
- }
- //---------------------------------------------------------------------------
-
- void __fastcall TForm1::GChange(TObject *Sender)
- {
- ShowColor();
- iG->Caption = G->Position;
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm1::BChange(TObject *Sender)
- {
- ShowColor();
- iB->Caption = B->Position;
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm1::BitBtn1Click(TObject *Sender)
- {
- Application->Terminate();
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm1::SaveClick(TObject *Sender)
- {
- FILE *file;
- DWORD onsenfout;
- AnsiString DATA2Write;
-
- DATA2Write = "Valeurs de la couleur :\n=======================\n\nRouge => "
- +IntToStr(R->Position) + "\nVert => " +IntToStr(G->Position) +
- "\nBleu => "+ IntToStr(B->Position);
-
- file = fopen("ColorCaught.txt","w");
-
- fprintf(file,DATA2Write.c_str());
-
- CloseHandle(file);
- }
- //---------------------------------------------------------------------------
-
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
#include "fstream.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormCreate(TObject *Sender)
{
R->Min = 0;
R->Max = 255;
G->Min = 0;
G->Max = 255;
B->Min = 0;
B->Max = 255;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::ShowColor()
{
Shape1->Brush->Color = RGB(R->Position,
G->Position,
B->Position );
}
void __fastcall TForm1::RChange(TObject *Sender)
{
ShowColor();
iR->Caption = R->Position;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::GChange(TObject *Sender)
{
ShowColor();
iG->Caption = G->Position;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::BChange(TObject *Sender)
{
ShowColor();
iB->Caption = B->Position;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::BitBtn1Click(TObject *Sender)
{
Application->Terminate();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::SaveClick(TObject *Sender)
{
FILE *file;
DWORD onsenfout;
AnsiString DATA2Write;
DATA2Write = "Valeurs de la couleur :\n=======================\n\nRouge => "
+IntToStr(R->Position) + "\nVert => " +IntToStr(G->Position) +
"\nBleu => "+ IntToStr(B->Position);
file = fopen("ColorCaught.txt","w");
fprintf(file,DATA2Write.c_str());
CloseHandle(file);
}
//---------------------------------------------------------------------------