home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2003 November / PCWK1103B.iso / PCWK-txt / Warsztat_Cpp_Builder / UnitNasycenie.cpp < prev    next >
C/C++ Source or Header  |  2003-09-22  |  2KB  |  52 lines

  1. //---------------------------------------------------------------------------
  2.  
  3. #include <vcl.h>
  4. #pragma hdrstop
  5.  
  6. #include "UnitNasycenie.h"
  7. #include "fotoretusz.h"
  8. //---------------------------------------------------------------------------
  9. #pragma package(smart_init)
  10. #pragma resource "*.dfm"
  11. TFormNasycenie *FormNasycenie;
  12. //---------------------------------------------------------------------------
  13. __fastcall TFormNasycenie::TFormNasycenie(TComponent* Owner)
  14.   : TForm(Owner)
  15. {
  16. }
  17. //---------------------------------------------------------------------------
  18. void __fastcall TFormNasycenie::tbNasycenieChange(TObject *Sender)
  19. {
  20.   edNasycenie->Text = IntToStr( tbNasycenie->Position );
  21.  
  22.   TMemoryStream *pms = new TMemoryStream;
  23.   pms->Position = 0;
  24.   rys1->Picture->Bitmap->SaveToStream( pms );
  25.   pms->Position = 0;
  26.   rys2->Picture->Bitmap->LoadFromStream( pms );
  27.   delete pms;
  28.  
  29.   DostosujNasycenie( rys2->Picture->Bitmap,tbNasycenie->Position );
  30. }
  31. //---------------------------------------------------------------------------
  32. void __fastcall TFormNasycenie::edNasycenieChange(TObject *Sender)
  33. {
  34.    int v;
  35.    if( TryStrToInt( edNasycenie->Text,v ) )
  36.      tbNasycenie->Position = v;
  37. }
  38. //---------------------------------------------------------------------------
  39. void __fastcall TFormNasycenie::FormShow(TObject *Sender)
  40. {
  41.   tbNasycenie->Position = 0;
  42.   edNasycenie->Text = "0";
  43.   TMemoryStream *pms = new TMemoryStream;
  44.   pms->Position = 0;
  45.   rys1->Picture->Bitmap->SaveToStream( pms );
  46.   pms->Position = 0;
  47.   rys2->Picture->Bitmap->LoadFromStream( pms );
  48.   delete pms;
  49. }
  50. //---------------------------------------------------------------------------
  51.  
  52.