124 int xDest,
int yDest,
int nDestWidth,
int nDestHeight,
125 int xSrc,
int ySrc,
int nSrcWidth,
int nSrcHeight,
138 m_hDC, xSrc, ySrc, nSrcWidth, nSrcHeight, bf);
153 return AlphaBlend(hDestDC, pointDest.
x, pointDest.
y, bSrcAlpha, bBlendOp);
164 bSrcAlpha, bBlendOp);
168 int nDestWidth,
int nDestHeight,
169 int xSrc,
int ySrc,
DWORD dwROP =
SRCCOPY)
const throw()
173 m_hDC, xSrc, ySrc, dwROP);
180 return BitBlt(hDestDC, xDest, yDest,
186 return BitBlt(hDestDC, pointDest.x, pointDest.y, dwROP);
191 return BitBlt(hDestDC, rectDest.left, rectDest.top,
192 rectDest.right - rectDest.left,
193 rectDest.bottom - rectDest.top,
194 pointSrc.x, pointSrc.y, dwROP);
216 BOOL Draw(
HDC hDestDC,
int xDest,
int yDest,
int nDestWidth,
int nDestHeight,
217 int xSrc,
int ySrc,
int nSrcWidth,
int nSrcHeight)
const throw()
222 return AlphaBlend(hDestDC, xDest, yDest, nDestWidth, nDestHeight,
223 xSrc, ySrc, nSrcWidth, nSrcHeight);
232 return TransparentBlt(hDestDC, xDest, yDest, nDestWidth, nDestHeight,
233 xSrc, ySrc, nSrcWidth, nSrcHeight,
rgb);
237 return StretchBlt(hDestDC, xDest, yDest, nDestWidth, nDestHeight,
238 xSrc, ySrc, nSrcWidth, nSrcHeight);
243 return Draw(hDestDC, rectDest.left, rectDest.top,
244 rectDest.right - rectDest.left,
245 rectDest.bottom - rectDest.top,
246 rectSrc.left, rectSrc.top,
247 rectSrc.right - rectSrc.left,
248 rectSrc.bottom - rectSrc.top);
256 return Draw(hDestDC, pointDest.x, pointDest.y);
259 int nDestWidth,
int nDestHeight)
const throw()
261 return Draw(hDestDC, xDest, yDest, nDestWidth, nDestHeight,
266 return Draw(hDestDC, rectDest.left, rectDest.top,
267 rectDest.right - rectDest.left,
268 rectDest.bottom - rectDest.top);
277 pb +=
m_bm.bmWidthBytes * (
m_bm.bmHeight - 1);
285 return m_bm.bmBitsPixel;
289 RGBQUAD* prgbColors)
const throw()
300 return m_bm.bmHeight;
308 switch (
m_bm.bmBitsPixel)
327 return -
m_bm.bmWidthBytes;
329 return m_bm.bmWidthBytes;
383 using namespace Gdiplus;
408 using namespace Gdiplus;
436 Attach(reinterpret_cast<HBITMAP>(hHandle));
444 int nDestWidth,
int nDestHeight,
int xSrc,
int ySrc,
445 HBITMAP hbmMask,
int xMask,
int yMask,
452 hbmMask, xMask, yMask, dwROP);
460 return MaskBlt(hDestDC, rectDest.left, rectDest.top,
461 rectDest.right - rectDest.left, rectDest.bottom - rectDest.top,
462 pointSrc.x, pointSrc.y, hbmMask, pointMask.x, pointMask.y, dwROP);
468 0, 0, hbmMask, 0, 0, dwROP);
473 return MaskBlt(hDestDC, pointDest.x, pointDest.y, hbmMask, dwROP);
477 int xSrc,
int ySrc,
int nSrcWidth,
int nSrcHeight,
479 int xMask = 0,
int yMask = 0)
const throw()
484 xSrc, ySrc, nSrcWidth, nSrcHeight,
485 hbmMask, xMask, yMask);
498 return PlgBlt(hDestDC, pPoints, rectSrc.left, rectSrc.top,
499 rectSrc.right - rectSrc.left, rectSrc.bottom - rectSrc.top,
500 hbmMask, pointMask.x, pointMask.y);
505 POINT pointMask = {0, 0};
506 return PlgBlt(hDestDC, pPoints, rectSrc, hbmMask, pointMask);
512 if (pCommon && pCommon->
Release() == 0)
521 using namespace Gdiplus;
545 using namespace Gdiplus;
581 const RGBQUAD* prgbColors)
throw()
618 int nDestWidth,
int nDestHeight,
619 int xSrc,
int ySrc,
int nSrcWidth,
int nSrcHeight,
624 m_hDC, xSrc, ySrc, nSrcWidth, nSrcHeight, dwROP);
629 int nDestWidth,
int nDestHeight,
632 return StretchBlt(hDestDC, xDest, yDest, nDestWidth, nDestHeight,
638 return StretchBlt(hDestDC, rectDest.left, rectDest.top,
639 rectDest.right - rectDest.left,
640 rectDest.bottom - rectDest.top, dwROP);
645 return StretchBlt(hDestDC, rectDest.left, rectDest.top,
646 rectDest.right - rectDest.left,
647 rectDest.bottom - rectDest.top,
648 rectSrc.left, rectSrc.top,
649 rectSrc.right - rectSrc.left,
650 rectSrc.bottom - rectSrc.top, dwROP);
654 int nDestWidth,
int nDestHeight,
655 int xSrc,
int ySrc,
int nSrcWidth,
int nSrcHeight,
661 nDestWidth, nDestHeight,
663 nSrcWidth, nSrcHeight, crTransparent);
668 int nDestWidth,
int nDestHeight,
671 return TransparentBlt(hDestDC, xDest, yDest, nDestWidth, nDestHeight,
678 rectDest.right - rectDest.left,
679 rectDest.bottom - rectDest.top, crTransparent);
682 HDC hDestDC,
const RECT& rectDest,
686 rectDest.right - rectDest.left, rectDest.bottom - rectDest.left,
687 rectSrc.left, rectSrc.top, rectSrc.right - rectSrc.left,
688 rectSrc.bottom - rectSrc.top, crTransparent);
723 LPCTSTR pszAllFilesDescription,
739 if (pszAllFilesDescription)
741 strFilter += pszAllFilesDescription;
742 strFilter += chSeparator;
747 if ((dwExclude &
table[
i].dwExclude) != 0)
753 strFilter +=
TEXT(
';');
755 strFilter +=
table[
i].extensions;
757 strFilter += chSeparator;
764 if ((dwExclude &
table[
i].dwExclude) != 0)
766 strFilter +=
table[
i].title;
767 strFilter +=
TEXT(
" (");
768 strFilter +=
table[
i].extensions;
769 strFilter +=
TEXT(
")");
770 strFilter += chSeparator;
771 strFilter +=
table[
i].extensions;
772 strFilter += chSeparator;
777 strFilter += chSeparator;
792 pszAllFilesDescription,
806 pszAllFilesDescription,
819 return reinterpret_cast<BITMAPINFO *>(
this);
823 return reinterpret_cast<const BITMAPINFO *>(
this);
838 typedef Gdiplus::GdiplusStartupInput
GSI;
839 typedef Gdiplus::GdiplusStartupOutput
GSO;
844 #define API WINGDIPAPI 845 #define CST GDIPCONST 911 template <
typename TYPE>
915 return reinterpret_cast<TYPE>(
proc);
926 Startup = AddrOf<STARTUP>(
"GdiplusStartup");
927 Shutdown = AddrOf<SHUTDOWN>(
"GdiplusShutdown");
929 AddrOf<GETIMAGEENCODERSSIZE>(
"GdipGetImageEncodersSize");
932 AddrOf<CREATEBITMAPFROMFILE>(
"GdipCreateBitmapFromFile");
934 AddrOf<CREATEHBITMAPFROMBITMAP>(
"GdipCreateHBITMAPFromBitmap");
936 AddrOf<CREATEBITMAPFROMSTREAM>(
"GdipCreateBitmapFromStream");
938 AddrOf<CREATEBITMAPFROMHBITMAP>(
"GdipCreateBitmapFromHBITMAP");
940 AddrOf<SAVEIMAGETOSTREAM>(
"GdipSaveImageToStream");
942 DisposeImage = AddrOf<DISPOSEIMAGE>(
"GdipDisposeImage");
1030 {
L".jpg", Gdiplus::ImageFormatJPEG},
1031 {
L".png", Gdiplus::ImageFormatPNG},
1032 {
L".bmp", Gdiplus::ImageFormatBMP},
1033 {
L".gif", Gdiplus::ImageFormatGIF},
1034 {
L".tif", Gdiplus::ImageFormatTIFF},
1035 {
L".jpeg", Gdiplus::ImageFormatJPEG},
1036 {
L".jpe", Gdiplus::ImageFormatJPEG},
1037 {
L".jfif", Gdiplus::ImageFormatJPEG},
1038 {
L".dib", Gdiplus::ImageFormatBMP},
1039 {
L".rle", Gdiplus::ImageFormatBMP},
1040 {
L".tiff", Gdiplus::ImageFormatTIFF}
1061 {Gdiplus::ImageFormatJPEG,
L"image/jpeg"},
1062 {Gdiplus::ImageFormatPNG,
L"image/png"},
1063 {Gdiplus::ImageFormatBMP,
L"image/bmp"},
1064 {Gdiplus::ImageFormatGIF,
L"image/gif"},
1065 {Gdiplus::ImageFormatTIFF,
L"image/tiff"}
1086 if (total_size == 0)
1092 pInfo = reinterpret_cast<Gdiplus::ImageCodecInfo *>(pb);
1098 for (
UINT iInfo = 0; iInfo <
count; ++iInfo)
1102 *
clsid = pInfo[iInfo].Clsid;
1115 if (::
UuidEqual(const_cast<GUID *>(&guid1),
1171 if (nBPP == 16 || nBPP == 32)
1175 pdwMask[0] = pdwBitmasks[0];
1176 pdwMask[1] = pdwBitmasks[1];
1177 pdwMask[2] = pdwBitmasks[2];
1217 #ifndef _ATL_NO_AUTOMATIC_NAMESPACE 1218 using namespace ATL;
BOOL TransparentBlt(HDC hDestDC, int xDest, int yDest, int nDestWidth, int nDestHeight, UINT crTransparent=CLR_INVALID) const
Gdiplus::ImageCodecInfo ICI
GLint GLint GLsizei width
BOOL AlphaBlend(HDC hDestDC, int xDest, int yDest, int nDestWidth, int nDestHeight, int xSrc, int ySrc, int nSrcWidth, int nSrcHeight, BYTE bSrcAlpha=0xFF, BYTE bBlendOp=AC_SRC_OVER) const
int GetMaxColorTableEntries() const
BOOL MaskBlt(HDC hDestDC, const RECT &rectDest, const POINT &pointSrc, HBITMAP hbmMask, const POINT &pointMask, DWORD dwROP=SRCCOPY) const
BOOL BitBlt(HDC hDestDC, const RECT &rectDest, const POINT &pointSrc, DWORD dwROP=SRCCOPY) const
static HRESULT GetCommonFilterString(CSimpleString &strFilter, CSimpleArray< GUID > &aguidFileTypes, LPCTSTR pszAllFilesDescription, DWORD dwExclude, TCHAR chSeparator)
void * GetPixelAddress(int x, int y)
static HRESULT GetImporterFilterString(CSimpleString &strImporters, CSimpleArray< GUID > &aguidFileTypes, LPCTSTR pszAllFilesDescription=NULL, DWORD dwExclude=excludeDefaultLoad, TCHAR chSeparator=TEXT('|'))
BOOL MaskBlt(HDC hDestDC, int xDest, int yDest, HBITMAP hbmMask, DWORD dwROP=SRCCOPY) const
GLdouble GLdouble GLdouble r
St(API * SAVEIMAGETOSTREAM)(Im *, IStream *, CST CLSID *, CST EncParams *)
struct tagBITMAPINFOHEADER BITMAPINFOHEADER
GLuint GLuint GLsizei count
void SetPixelRGB(int x, int y, BYTE r, BYTE g, BYTE b)
BOOL StretchBlt(HDC hDestDC, int xDest, int yDest, int nDestWidth, int nDestHeight, int xSrc, int ySrc, int nSrcWidth, int nSrcHeight, DWORD dwROP=SRCCOPY) const
GETIMAGEENCODERSSIZE GetImageEncodersSize
BOOL TransparentBlt(HDC hDestDC, int xDest, int yDest, int nDestWidth, int nDestHeight, int xSrc, int ySrc, int nSrcWidth, int nSrcHeight, UINT crTransparent=CLR_INVALID) const
void LoadFromResource(HINSTANCE hInstance, UINT nIDResource)
BOOL CreateEx(int nWidth, int nHeight, int nBPP, DWORD eCompression, const DWORD *pdwBitmasks=NULL, DWORD dwFlags=0)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
CREATEBITMAPFROMSTREAM CreateBitmapFromStream
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
GLint GLint GLint GLint GLint x
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
const BITMAPINFO * get() const
int WINAPI UuidEqual(UUID *Uuid1, UUID *Uuid2, RPC_STATUS *Status)
void LoadFromResource(HINSTANCE hInstance, LPCTSTR pszResourceName)
CREATEBITMAPFROMFILE CreateBitmapFromFile
static HRESULT GetExporterFilterString(CSimpleString &strExporters, CSimpleArray< GUID > &aguidFileTypes, LPCTSTR pszAllFilesDescription=NULL, DWORD dwExclude=excludeDefaultSave, TCHAR chSeparator=TEXT('|'))
HRESULT Load(LPCTSTR pszFileName)
_In_ SURFOBJ _In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ RECTL _In_ RECTL _In_ ULONG iTransColor
BOOL Draw(HDC hDestDC, int xDest, int yDest, int nDestWidth, int nDestHeight) const
St(API * GETIMAGEENCODERSSIZE)(UINT *, UINT *)
const GUID * FileTypeFromExtension(LPCWSTR pszExt) const
BOOL TransparentBlt(HDC hDestDC, const RECT &rectDest, const RECT &rectSrc, UINT crTransparent=CLR_INVALID) const
BOOL BitBlt(HDC hDestDC, int xDest, int yDest, int nDestWidth, int nDestHeight, int xSrc, int ySrc, DWORD dwROP=SRCCOPY) const
int WINAPI lstrcmpiW(LPCWSTR lpString1, LPCWSTR lpString2)
BOOL Draw(HDC hDestDC, int xDest, int yDest, int nDestWidth, int nDestHeight, int xSrc, int ySrc, int nSrcWidth, int nSrcHeight) const
void AttachInternal(HBITMAP hBitmap, DIBOrientation eOrientation, LONG iTransColor)
BOOL TransparentBlt(HDC hDestDC, const RECT &rectDest, UINT crTransparent=CLR_INVALID) const
BOOL StretchBlt(HDC hDestDC, const RECT &rectDest, DWORD dwROP=SRCCOPY) const
St(API * CREATEBITMAPFROMSTREAM)(IStream *, Bm **)
DISPOSEIMAGE DisposeImage
_In_ WDFDEVICE _In_ WDF_SPECIAL_FILE_TYPE FileType
St(API * SAVEIMAGETOFILE)(Im *, CST WCHAR *, CST CLSID *, CST EncParams *)
void SetPixel(int x, int y, COLORREF color)
BOOL AlphaBlend(HDC hDestDC, const POINT &pointDest, BYTE bSrcAlpha=0xFF, BYTE bBlendOp=AC_SRC_OVER) const
BOOL StretchBlt(HDC hDestDC, const RECT &rectDest, const RECT &rectSrc, DWORD dwROP=SRCCOPY) const
BOOL StretchBlt(HDC hDestDC, int xDest, int yDest, int nDestWidth, int nDestHeight, DWORD dwROP=SRCCOPY) const
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
WORD WORD PSZ PSZ pszFileName
St(API * DISPOSEIMAGE)(Im *)
static COMMON *& GetCommonPtr()
St(API * GETIMAGEENCODERS)(UINT, UINT, ICI *)
UINT WINAPI SetDIBColorTable(_In_ HDC hdc, _In_ UINT iStart, _In_ UINT cEntries, _In_reads_(cEntries) const RGBQUAD *prgbq)
UINT WINAPI GetDIBColorTable(HDC hDC, UINT iStartIndex, UINT cEntries, RGBQUAD *pColors)
BOOL AlphaBlend(HDC hDestDC, const RECT &rectDest, const RECT &rectSrc, BYTE bSrcAlpha=0xFF, BYTE bBlendOp=AC_SRC_OVER) const
COLORREF RGBFromPaletteIndex(int iIndex) const
BOOL MaskBlt(HDC hDestDC, const POINT &pointDest, HBITMAP hbmMask, DWORD dwROP=SRCCOPY) const
COLORREF SetTransparentColor(COLORREF rgbTransparent)
St(API * CREATEBITMAPFROMHBITMAP)(HBM, HPALETTE, Bm **)
GETIMAGEENCODERS GetImageEncoders
BOOL PlgBlt(HDC hDestDC, const POINT *pPoints, const RECT &rectSrc, HBITMAP hbmMask, const POINT &pointMask) const
GLboolean GLboolean GLboolean b
HRESULT Save(IStream *pStream, GUID *guidFileType) const
BOOL BitBlt(HDC hDestDC, int xDest, int yDest, DWORD dwROP=SRCCOPY) const
BOOL AlphaBlend(HDC hDestDC, int xDest, int yDest, BYTE bSrcAlpha=0xFF, BYTE bBlendOp=AC_SRC_OVER) const
HRESULT Save(LPCTSTR pszFileName, REFGUID guidFileType=GUID_NULL) const
LPCWSTR GetFileExtension(LPCWSTR pszFileName) const
struct EncoderParameters EncoderParameters
SAVEIMAGETOSTREAM SaveImageToStream
TYPE AddrOf(const char *name)
bool GetClsidFromFileType(CLSID *clsid, const GUID *guid) const
int GetEncoderClsid(LPCWSTR mime, CLSID *clsid) const
void SetPixelIndexed(int x, int y, int iIndex)
BOOL PlgBlt(HDC hDestDC, const POINT *pPoints, int xSrc, int ySrc, int nSrcWidth, int nSrcHeight, HBITMAP hbmMask=NULL, int xMask=0, int yMask=0) const
typedef void(__stdcall _ATL_TERMFUNC)(DWORD_PTR dw)
Gdiplus::GdiplusStartupOutput GSO
static BOOL IsTransparencySupported()
static COMMON & GetCommon()
BOOL Draw(HDC hDestDC, const RECT &rectDest) const
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
static void quad(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3, GLuint pv)
BITMAPINFOHEADER bmiHeader
COLORREF GetTransparentColor() const
SAVEIMAGETOFILE SaveImageToFile
GLint GLint GLsizei GLsizei height
struct ImageCodecInfo ImageCodecInfo
St(API * CREATEHBITMAPFROMBITMAP)(Bm *, HBM *, ARGB)
CImage & operator=(const CImage &)
Gdiplus::GdiplusStartupInput gdiplusStartupInput
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
BOOL CreateInternal(int nWidth, int nHeight, int nBPP, DWORD eCompression, const DWORD *pdwBitmasks=NULL, DWORD dwFlags=0)
_In_ ULONG _In_ ULONG rgb
BOOL WINAPI DeleteDC(_In_ HDC)
HBITMAP WINAPI CreateDIBSection(HDC hDC, CONST BITMAPINFO *BitmapInfo, UINT Usage, VOID **Bits, HANDLE hSection, DWORD dwOffset)
#define LR_CREATEDIBSECTION
BOOL Draw(HDC hDestDC, const RECT &rectDest, const RECT &rectSrc) const
BOOL PlgBlt(HDC hDestDC, const POINT *pPoints, HBITMAP hbmMask=NULL) const
HRESULT Load(IStream *pStream)
static ULONG WINAPI AddRef(IStream *iface)
GLint GLint GLint GLint GLint GLint y
CREATEBITMAPFROMHBITMAP CreateBitmapFromHBITMAP
Gdiplus::GdiplusStartupInput GSI
COLORREF GetPixel(int x, int y) const
St(WINAPI * STARTUP)(ULONG_PTR *, const GSI *, GSO *)
DIBOrientation m_eOrientation
BOOL BitBlt(HDC hDestDC, const POINT &pointDest, DWORD dwROP=SRCCOPY) const
St(API * CREATEBITMAPFROMFILE)(CST WCHAR *, Bm **)
Gdiplus::EncoderParameters EncParams
BOOL Draw(HDC hDestDC, int xDest, int yDest) const
void GetColorTable(UINT iFirstColor, UINT nColors, RGBQUAD *prgbColors) const
CREATEHBITMAPFROMBITMAP CreateHBITMAPFromBitmap
#define GetProcAddress(x, y)
BOOL PlgBlt(HDC hDestDC, const POINT *pPoints, const RECT &rectSrc, HBITMAP hbmMask=NULL) const
BOOL Create(int nWidth, int nHeight, int nBPP, DWORD dwFlags=0)
BOOL WINAPI SetPixelV(_In_ HDC, _In_ int, _In_ int, _In_ COLORREF)
struct tagDIBSECTION DIBSECTION
bool IsGuidEqual(const GUID &guid1, const GUID &guid2) const
void(WINAPI * SHUTDOWN)(ULONG_PTR)
static SERVICE_STATUS status
BOOL Draw(HDC hDestDC, const POINT &pointDest) const
bool IsDIBSection() const
void Attach(HBITMAP hBitmap, DIBOrientation eOrientation=DIBOR_DEFAULT)
BOOL MaskBlt(HDC hDestDC, int xDest, int yDest, int nDestWidth, int nDestHeight, int xSrc, int ySrc, HBITMAP hbmMask, int xMask, int yMask, DWORD dwROP=SRCCOPY) const
void SetColorTable(UINT iFirstColor, UINT nColors, const RGBQUAD *prgbColors)