home *** CD-ROM | disk | FTP | other *** search
- //---------------------------------------------------------------------------
-
- #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 );
- }
- //---------------------------------------------------------------------------
-