home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 2003 November
/
PCWK1103B.iso
/
PCWK-txt
/
Warsztat_Cpp_Builder
/
UnitKontrast.cpp
< prev
next >
Wrap
C/C++ Source or Header
|
2003-09-21
|
2KB
|
51 lines
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "UnitKontrast.h"
#include "Fotoretusz.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TFormKontrast *FormKontrast;
//---------------------------------------------------------------------------
__fastcall TFormKontrast::TFormKontrast(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TFormKontrast::tbKontrastChange(TObject *Sender)
{
edKontrast->Text = IntToStr( tbKontrast->Position );
TMemoryStream *pms = new TMemoryStream;
pms->Position = 0;
rys1->Picture->Bitmap->SaveToStream( pms );
pms->Position = 0;
rys2->Picture->Bitmap->LoadFromStream( pms );
delete pms;
DostosujKontrast( rys2->Picture->Bitmap,tbKontrast->Position );
}
//---------------------------------------------------------------------------
void __fastcall TFormKontrast::edKontrastChange(TObject *Sender)
{
int v;
if( TryStrToInt( edKontrast->Text,v ) )
tbKontrast->Position = v;
}
//---------------------------------------------------------------------------
void __fastcall TFormKontrast::FormShow(TObject *Sender)
{
tbKontrast->Position = 0;
edKontrast->Text = "0";
TMemoryStream *pms = new TMemoryStream;
pms->Position = 0;
rys1->Picture->Bitmap->SaveToStream( pms );
pms->Position = 0;
rys2->Picture->Bitmap->LoadFromStream( pms );
delete pms;
}
//---------------------------------------------------------------------------