146 lines
2.8 KiB
C++
146 lines
2.8 KiB
C++
#ifndef _IMAGELIST_IMAGEINFO_HPP_
|
|
#define _IMAGELIST_IMAGEINFO_HPP_
|
|
#ifndef _COMMON_WINDOWS_HPP_
|
|
#include <common/windows.hpp>
|
|
#endif
|
|
#ifndef _COMMON_COMMCTRL_HPP_
|
|
#include <common/commctrl.hpp>
|
|
#endif
|
|
#ifndef _COMMON_RECTANGLE_HPP_
|
|
#include <common/rect.hpp>
|
|
#endif
|
|
|
|
class ImageInfo : private _IMAGEINFO
|
|
{
|
|
public:
|
|
ImageInfo(void);
|
|
ImageInfo(const ImageInfo &someImageInfo);
|
|
~ImageInfo();
|
|
ImageInfo &operator=(const ImageInfo &someImageInfo);
|
|
WORD operator==(const ImageInfo &someImageInfo)const;
|
|
operator _IMAGEINFO&(void);
|
|
HBITMAP colorBitmap(void)const;
|
|
HBITMAP maskBitmap(void)const;
|
|
DWORD planes(void)const;
|
|
DWORD bitsPerPixel(void)const;
|
|
Rect boundingRect(void)const;
|
|
private:
|
|
void colorBitmap(HBITMAP hbmColorBitmap);
|
|
void maskBitmap(HBITMAP hbmMaskBitmap);
|
|
void planes(DWORD planes);
|
|
void bitsPerPixel(DWORD bitsPerPixel);
|
|
void boundingRect(const Rect &boundingRect);
|
|
};
|
|
|
|
inline
|
|
ImageInfo::ImageInfo(void)
|
|
{
|
|
colorBitmap(0);
|
|
maskBitmap(0);
|
|
planes(0);
|
|
bitsPerPixel(0);
|
|
boundingRect(Rect());
|
|
}
|
|
|
|
inline
|
|
ImageInfo::ImageInfo(const ImageInfo &someImageInfo)
|
|
{
|
|
*this=someImageInfo;
|
|
}
|
|
|
|
inline
|
|
ImageInfo::~ImageInfo()
|
|
{
|
|
}
|
|
|
|
inline
|
|
ImageInfo &ImageInfo::operator=(const ImageInfo &someImageInfo)
|
|
{
|
|
colorBitmap(someImageInfo.colorBitmap());
|
|
maskBitmap(someImageInfo.maskBitmap());
|
|
planes(someImageInfo.planes());
|
|
bitsPerPixel(someImageInfo.bitsPerPixel());
|
|
boundingRect(someImageInfo.boundingRect());
|
|
return *this;
|
|
}
|
|
|
|
inline
|
|
WORD ImageInfo::operator==(const ImageInfo &someImageInfo)const
|
|
{
|
|
return (colorBitmap()==someImageInfo.colorBitmap()&&
|
|
maskBitmap()==someImageInfo.maskBitmap()&&
|
|
planes()==someImageInfo.planes()&&
|
|
bitsPerPixel()==someImageInfo.bitsPerPixel()&&
|
|
boundingRect()==someImageInfo.boundingRect());
|
|
}
|
|
|
|
inline
|
|
ImageInfo::operator _IMAGEINFO&(void)
|
|
{
|
|
return *this;
|
|
}
|
|
|
|
inline
|
|
HBITMAP ImageInfo::colorBitmap(void)const
|
|
{
|
|
return _IMAGEINFO::hbmImage;
|
|
}
|
|
|
|
inline
|
|
void ImageInfo::colorBitmap(HBITMAP hbmColorBitmap)
|
|
{
|
|
_IMAGEINFO::hbmImage=hbmColorBitmap;
|
|
}
|
|
|
|
inline
|
|
HBITMAP ImageInfo::maskBitmap(void)const
|
|
{
|
|
return _IMAGEINFO::hbmMask;
|
|
}
|
|
|
|
inline
|
|
void ImageInfo::maskBitmap(HBITMAP hbmMaskBitmap)
|
|
{
|
|
_IMAGEINFO::hbmMask=hbmMaskBitmap;
|
|
}
|
|
|
|
inline
|
|
DWORD ImageInfo::planes(void)const
|
|
{
|
|
return _IMAGEINFO::Unused1;
|
|
}
|
|
|
|
inline
|
|
void ImageInfo::planes(DWORD planes)
|
|
{
|
|
_IMAGEINFO::Unused1=planes;
|
|
}
|
|
|
|
inline
|
|
DWORD ImageInfo::bitsPerPixel(void)const
|
|
{
|
|
return _IMAGEINFO::Unused2;
|
|
}
|
|
|
|
inline
|
|
void ImageInfo::bitsPerPixel(DWORD bitsPerPixel)
|
|
{
|
|
_IMAGEINFO::Unused2=bitsPerPixel;
|
|
}
|
|
|
|
inline
|
|
Rect ImageInfo::boundingRect(void)const
|
|
{
|
|
return Rect(_IMAGEINFO::rcImage);
|
|
}
|
|
|
|
inline
|
|
void ImageInfo::boundingRect(const Rect &boundingRect)
|
|
{
|
|
_IMAGEINFO::rcImage.left=boundingRect.left();
|
|
_IMAGEINFO::rcImage.top=boundingRect.top();
|
|
_IMAGEINFO::rcImage.right=boundingRect.right();
|
|
_IMAGEINFO::rcImage.bottom=boundingRect.bottom();
|
|
}
|
|
#endif
|