home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 2003 November
/
PCWK1103B.iso
/
PCWK-txt
/
Warsztat_Cpp_Builder
/
UnitEdytorFiltrow.cpp
< prev
next >
Wrap
C/C++ Source or Header
|
2003-09-22
|
1KB
|
49 lines
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "UnitEdytorFiltrow.h"
#include "fotoretusz.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TFormEdytor *FormEdytor;
//---------------------------------------------------------------------------
__fastcall TFormEdytor::TFormEdytor(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TFormEdytor::FormShow(TObject *Sender)
{
for( int i=0;i<3;i++)
for( int j=0; j<3; j++)
sgFiltr->Cells[i][j] = "0";
sgFiltr->Cells[1][1] = "1";
}
//---------------------------------------------------------------------------
void __fastcall TFormEdytor::BitBtn3Click(TObject *Sender)
{
double f[3][3];
for( int i=0;i<3;i++)
for( int j=0; j<3; j++)
{
if( !TryStrToFloat( Trim(sgFiltr->Cells[i][j]), f[i][j]) )
f[i][j] = 0.0;
}
TMemoryStream *pms = new TMemoryStream;
pms->Position = 0;
rys1->Picture->Bitmap->SaveToStream( pms );
pms->Position = 0;
rys2->Picture->Bitmap->LoadFromStream( pms );
delete pms;
Filtr3x3( rys1->Picture->Bitmap,rys2->Picture->Bitmap, f );
}
//---------------------------------------------------------------------------