You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
1.4 KiB
C++

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#pragma once
#include "WException.h"
namespace wuya
{
/** @brief ImageÒì³£Àà */
class AFX_EXT_CLASS WExceptionImage : public WException
{
public:
WExceptionImage() throw() : WException(_T("ExceptionImage")) {}
WExceptionImage(std::string msg) throw() : WException(msg) {}
WExceptionImage(std::string msg,std::string location) throw() : WException(msg,location) {}
};
/** @brief ͼÏñ¸ñʽ¶¨Òå */
enum IMAGE_FORMAT
{
IF_BMP, ///< BMP¸ñʽ
IF_JPG ///< JPG¸ñʽ
};
/** @brief ͼÏñ»ùÀà */
class AFX_EXT_CLASS CImage
{
public:
CImage(void) {};
virtual ~CImage(void) {};
virtual void Load(CString strFileName) throw(WExceptionImage) = 0;
virtual void Load(CFile* pFile) throw(WExceptionImage) = 0;
virtual void Save(CString strFileName) throw(WExceptionImage) = 0;
virtual void Save(CFile* pFile) throw(WExceptionImage) = 0;
virtual void Draw(CDC* pdc, int x=0, int y=0, double scale = 1.0, DWORD dwROPCode = SRCCOPY) const throw(WExceptionImage) = 0;
virtual void Draw(CDC* pdc, int x, int y, int width, int height, DWORD dwROPCode = SRCCOPY) const throw(WExceptionImage) = 0;
virtual void Create(int width, int height, LPBYTE pData, int bitCount=24) throw(WExceptionImage) = 0;
virtual UINT GetWidth() const throw() = 0;
virtual UINT GetHeight() const throw() = 0;
virtual UINT GetBPP() const throw() = 0;
virtual COLORREF GetPixel(int x, int y) const throw() = 0;
virtual LPBYTE GetDibBits() const throw() = 0;
};
}