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

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