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

  1. //---------------------------------------------------------------------------
  2.  
  3. #include <vcl.h>
  4. #pragma hdrstop
  5.  
  6. #include "UnitGamma.h"
  7. #include "Fotoretusz.h"
  8. //---------------------------------------------------------------------------
  9. #pragma package(smart_init)
  10. #pragma resource "*.dfm"
  11. TFormGamma *FormGamma;
  12. //---------------------------------------------------------------------------
  13. __fastcall TFormGamma::TFormGamma(TComponent* Owner)
  14.   : TForm(Owner)
  15. {
  16. }
  17. //---------------------------------------------------------------------------
  18.  
  19. void __fastcall TFormGamma::tbGammaChange(TObject *Sender)
  20. {
  21.   edGamma->Text = FloatToStr( 1+tbGamma->Position/100.0 );
  22.  
  23.   TMemoryStream *pms = new TMemoryStream;
  24.   pms->Position = 0;
  25.   rys1->Picture->Bitmap->SaveToStream( pms );
  26.   pms->Position = 0;
  27.   rys2->Picture->Bitmap->LoadFromStream( pms );
  28.   delete pms;
  29.   DostosujGamma( rys2->Picture->Bitmap,1+tbGamma->Position/100.0 );
  30. }
  31. //---------------------------------------------------------------------------
  32.  
  33. void __fastcall TFormGamma::edGammaChange(TObject *Sender)
  34. {
  35.  double v;
  36.  if( TryStrToFloat(edGamma->Text,v) )
  37.    tbGamma->Position = (int) (v-1)*100;
  38. }
  39. //---------------------------------------------------------------------------
  40.