//---------------------------------------------------------------------------
#ifndef pngimageH
#define pngimageH
//---------------------------------------------------------------------------
#include <SysUtils.hpp>
#include <Controls.hpp>
#include <Classes.hpp>
#include <Forms.hpp>

#include "pngencod.h"
#include "pngdecod.h"

//---------------------------------------------------------------------------
class PACKAGE TPngImage : public TGraphic
{
private:
  BitmapImage image ;
  PngEncoder encoder ;
  PngDecoder decoder ;

  Graphics::TBitmap *bitmap ;

protected:
    virtual PngEncoder * __fastcall GetEncoder () ;

public:
    virtual __fastcall TPngImage();
    virtual __fastcall ~TPngImage();
    virtual void __fastcall Draw (TCanvas *canvas, const TRect &rect) ;
    virtual bool __fastcall GetEmpty () ;
    virtual int __fastcall GetHeight () ;
    virtual int __fastcall GetWidth () ;
    virtual void __fastcall  SetHeight (int) ;
    virtual void __fastcall  SetWidth (int) ;
    virtual void __fastcall LoadFromStream (TStream *) ;
    virtual void __fastcall SaveToStream (TStream *) ;
    virtual void __fastcall LoadFromClipboardFormat (Word, int, HPALETTE) ;
    virtual void __fastcall SaveToClipboardFormat (Word &, int &, HPALETTE &) ;
    virtual void __fastcall SetPalette (HPALETTE) ;
    virtual void __fastcall Assign (TPersistent *source) ;
    virtual void __fastcall AssignTo (TPersistent *dest) ;

    __property PngEncoder *Encoder = { read = GetEncoder } ;

__published:
};
//---------------------------------------------------------------------------
#endif
