home *** CD-ROM | disk | FTP | other *** search
/ Compressed Image File Formats / CompressedImageFileFormatsJohnMiano.iso / pc / Library / BCBViewer / ChildWin.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-12-17  |  2.6 KB  |  77 lines

  1. //----------------------------------------------------------------------------
  2. #ifndef ChildWinH
  3. #define ChildWinH
  4. //
  5. // Copyright (c) 1998 Colosseum Builders, Inc.
  6. // All rights reserved.
  7. //
  8. // Colosseum Builders, Inc. makes no warranty, expressed or implied
  9. // with regards to this software. It is provided as is.
  10. //
  11. // Permission to use, redistribute, and copy this file is granted
  12. // without a fee so long as as the following conditions are adhered to:
  13. //
  14. // o The user assumes all risk for using this software. The authors of this
  15. //   software shall be liable for no damages of any kind.
  16. //
  17. // o If the source code is distributed then this copyright notice must
  18. //   remain unaltered and any modification must be noted.
  19. //
  20. // o If this code is shipped in binary format the accompanying documentation
  21. //   should state that "this software is based, in part, on the work of
  22. //   Colosseum Builders, Inc."
  23. //
  24.  
  25. //
  26. //  Title:  Sample Image Viewer/Format Conversion Application
  27. //
  28. //  Author:  John M. Miano miano@colosseumbuilders.com
  29. //
  30. //----------------------------------------------------------------------------
  31. #include <Controls.hpp>
  32. #include <Forms.hpp>
  33. #include <Graphics.hpp>
  34. #include <Classes.hpp>
  35. #include <Windows.hpp>
  36. #include <System.hpp>
  37. #include <ExtCtrls.hpp>
  38.  
  39. #include "EditableBitmap.h"
  40. #include "ImageTyp.h"
  41.  
  42. //----------------------------------------------------------------------------
  43. class TMDIChild : public TForm
  44. {
  45. __published:
  46.   TPaintBox *PaintBox;
  47.   void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
  48.   void __fastcall PaintBoxPaint(TObject *Sender);
  49.  
  50.   
  51. private:
  52.   void LoadBitmapInfoHeader () ;
  53.  
  54.   EditableBitmapImage image ;
  55.   ImageType image_type ;
  56.   char bitinfobuffer [sizeof (BITMAPINFOHEADER) + 256 * sizeof (RGBQUAD)] ;
  57.   double gamma_value ;
  58.   void __fastcall SetGammaValue (double) ;
  59. public:
  60.   void ReadImage (const String &) ;
  61.   ImageType GetImageType () { return image_type ; }
  62.     virtual __fastcall TMDIChild(TComponent *Owner);
  63.   void Grayscale () ;
  64.   void CopyToClipboard () ;
  65.   void CopyFromClipboard () ;
  66.   BitmapImage &GetImage () { return image ; }
  67.   friend void ProgressFunction (BitmapImageCoder &coder,
  68.                               void *data,
  69.                               unsigned int currentpass,
  70.                               unsigned int passcount,
  71.                               unsigned int progress,
  72.                               bool &cancel) ;
  73.   __property double GammaValue = { read=gamma_value, write=SetGammaValue } ;
  74. };
  75. //----------------------------------------------------------------------------
  76. #endif
  77.