104 lines
1.9 KiB
C++
104 lines
1.9 KiB
C++
#ifndef _BONEYARD_PUREIMAGE_HPP_
|
|
#define _BONEYARD_PUREIMAGE_HPP_
|
|
#ifndef _COMMON_WINDOWS_HPP_
|
|
#include <common/windows.hpp>
|
|
#endif
|
|
#ifndef _COMMON_DIBITMAP_HPP_
|
|
#include <common/dib.hpp>
|
|
#endif
|
|
#ifndef _COMMON_BITMAPINFO_HPP_
|
|
#include <common/bminfo.hpp>
|
|
#endif
|
|
|
|
class String;
|
|
class PureDevice;
|
|
|
|
class PureImage
|
|
{
|
|
public:
|
|
PureImage(void);
|
|
virtual ~PureImage();
|
|
bool draw(PureDevice &pureDevice);
|
|
bool draw(PureDevice &pureDevice,int xSrc,int ySrc);
|
|
bool draw(PureDevice &pureDevice,const Rect &dstRect,const Point &srcPoint);
|
|
bool stretch(PureDevice &pureDevice,const Point &xyPoint,int strwidth,int strheight);
|
|
bool decode(BitmapInfo &bitmapInfo,GlobalData<BYTE> &bitmapBytes,PureDevice pureDevice);
|
|
const BitmapInfo &getBitmapInfo(void)const;
|
|
BitmapInfo &getBitmapInfo(void);
|
|
int height(void)const;
|
|
int width(void)const;
|
|
bool isOkay(void)const;
|
|
private:
|
|
PureImage(const PureImage &somePureImage);
|
|
PureImage &operator=(const PureImage &somePureImage);
|
|
void destroy(void);
|
|
|
|
HBITMAP mhBitmap;
|
|
BitmapInfo mBitmapInfo;
|
|
};
|
|
|
|
inline
|
|
PureImage::PureImage(void)
|
|
: mhBitmap(0)
|
|
{
|
|
}
|
|
|
|
inline
|
|
PureImage::PureImage(const PureImage &somePureImage)
|
|
: mhBitmap(0)
|
|
{ // private implementation
|
|
*this=somePureImage;
|
|
}
|
|
|
|
inline
|
|
PureImage &PureImage::operator=(const PureImage &somePureImage)
|
|
{ // private implementation
|
|
return *this;
|
|
}
|
|
|
|
inline
|
|
PureImage::~PureImage()
|
|
{
|
|
destroy();
|
|
}
|
|
|
|
inline
|
|
int PureImage::width(void)const
|
|
{
|
|
return getBitmapInfo().width();
|
|
}
|
|
|
|
inline
|
|
int PureImage::height(void)const
|
|
{
|
|
if(getBitmapInfo().height()<0)return -getBitmapInfo().height();
|
|
return getBitmapInfo().height();
|
|
}
|
|
|
|
inline
|
|
bool PureImage::isOkay(void)const
|
|
{
|
|
return mhBitmap?TRUE:FALSE;
|
|
}
|
|
|
|
inline
|
|
void PureImage::destroy(void)
|
|
{
|
|
if(!mhBitmap)return;
|
|
::DeleteObject(mhBitmap);
|
|
mhBitmap=0;
|
|
}
|
|
|
|
inline
|
|
BitmapInfo &PureImage::getBitmapInfo(void)
|
|
{
|
|
return mBitmapInfo;
|
|
}
|
|
|
|
inline
|
|
const BitmapInfo &PureImage::getBitmapInfo(void)const
|
|
{
|
|
return mBitmapInfo;
|
|
}
|
|
#endif
|