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;
410 using namespace Gdiplus;
412 if (
GetCommon().CreateBitmapFromStream(pStream, &pBitmap) !=
Ok)
448 int nDestWidth,
int nDestHeight,
int xSrc,
int ySrc,
449 HBITMAP hbmMask,
int xMask,
int yMask,
456 hbmMask, xMask, yMask, dwROP);
464 return MaskBlt(hDestDC, rectDest.left, rectDest.top,
465 rectDest.right - rectDest.left, rectDest.bottom - rectDest.top,
466 pointSrc.x, pointSrc.y, hbmMask, pointMask.x, pointMask.y, dwROP);
472 0, 0, hbmMask, 0, 0, dwROP);
477 return MaskBlt(hDestDC, pointDest.x, pointDest.y, hbmMask, dwROP);
481 int xSrc,
int ySrc,
int nSrcWidth,
int nSrcHeight,
483 int xMask = 0,
int yMask = 0)
const throw()
488 xSrc, ySrc, nSrcWidth, nSrcHeight,
489 hbmMask, xMask, yMask);
502 return PlgBlt(hDestDC, pPoints, rectSrc.left, rectSrc.top,
503 rectSrc.right - rectSrc.left, rectSrc.bottom - rectSrc.top,
504 hbmMask, pointMask.x, pointMask.y);
509 POINT pointMask = {0, 0};
510 return PlgBlt(hDestDC, pPoints, rectSrc, hbmMask, pointMask);
516 if (pCommon && pCommon->
Release() == 0)
525 using namespace Gdiplus;
550 using namespace Gdiplus;
586 const RGBQUAD* prgbColors)
throw()
623 int nDestWidth,
int nDestHeight,
624 int xSrc,
int ySrc,
int nSrcWidth,
int nSrcHeight,
629 m_hDC, xSrc, ySrc, nSrcWidth, nSrcHeight, dwROP);
634 int nDestWidth,
int nDestHeight,
637 return StretchBlt(hDestDC, xDest, yDest, nDestWidth, nDestHeight,
643 return StretchBlt(hDestDC, rectDest.left, rectDest.top,
644 rectDest.right - rectDest.left,
645 rectDest.bottom - rectDest.top, dwROP);
650 return StretchBlt(hDestDC, rectDest.left, rectDest.top,
651 rectDest.right - rectDest.left,
652 rectDest.bottom - rectDest.top,
653 rectSrc.left, rectSrc.top,
654 rectSrc.right - rectSrc.left,
655 rectSrc.bottom - rectSrc.top, dwROP);
659 int nDestWidth,
int nDestHeight,
660 int xSrc,
int ySrc,
int nSrcWidth,
int nSrcHeight,
666 nDestWidth, nDestHeight,
668 nSrcWidth, nSrcHeight, crTransparent);
673 int nDestWidth,
int nDestHeight,
676 return TransparentBlt(hDestDC, xDest, yDest, nDestWidth, nDestHeight,
683 rectDest.right - rectDest.left,
684 rectDest.bottom - rectDest.top, crTransparent);
687 HDC hDestDC,
const RECT& rectDest,
691 rectDest.right - rectDest.left, rectDest.bottom - rectDest.left,
692 rectSrc.left, rectSrc.top, rectSrc.right - rectSrc.left,
693 rectSrc.bottom - rectSrc.top, crTransparent);
728 LPCTSTR pszAllFilesDescription,
744 if (pszAllFilesDescription)
746 strFilter += pszAllFilesDescription;
747 strFilter += chSeparator;
752 if ((dwExclude &
table[
i].dwExclude) != 0)
758 strFilter +=
TEXT(
';');
760 strFilter +=
table[
i].extensions;
762 strFilter += chSeparator;
769 if ((dwExclude &
table[
i].dwExclude) != 0)
771 strFilter +=
table[
i].title;
772 strFilter +=
TEXT(
" (");
773 strFilter +=
table[
i].extensions;
774 strFilter +=
TEXT(
")");
775 strFilter += chSeparator;
776 strFilter +=
table[
i].extensions;
777 strFilter += chSeparator;
782 strFilter += chSeparator;
797 pszAllFilesDescription,
811 pszAllFilesDescription,
828 return reinterpret_cast<const BITMAPINFO *
>(
this);
833 typedef Gdiplus::GpStatus
St;
834 typedef Gdiplus::GpBitmap
Bm;
835 typedef Gdiplus::GpImage
Im;
841 typedef Gdiplus::ImageCodecInfo
ICI;
845 typedef Gdiplus::GdiplusStartupInput
GSI;
846 typedef Gdiplus::GdiplusStartupOutput
GSO;
851#define API WINGDIPAPI
918 template <
typename TYPE>
922 return reinterpret_cast<TYPE>(
proc);
933 Startup = AddrOf<STARTUP>(
"GdiplusStartup");
934 Shutdown = AddrOf<SHUTDOWN>(
"GdiplusShutdown");
936 AddrOf<GETIMAGEENCODERSSIZE>(
"GdipGetImageEncodersSize");
939 AddrOf<CREATEBITMAPFROMFILE>(
"GdipCreateBitmapFromFile");
941 AddrOf<CREATEHBITMAPFROMBITMAP>(
"GdipCreateHBITMAPFromBitmap");
943 AddrOf<CREATEBITMAPFROMSTREAM>(
"GdipCreateBitmapFromStream");
945 AddrOf<CREATEBITMAPFROMHBITMAP>(
"GdipCreateBitmapFromHBITMAP");
947 AddrOf<SAVEIMAGETOSTREAM>(
"GdipSaveImageToStream");
949 DisposeImage = AddrOf<DISPOSEIMAGE>(
"GdipDisposeImage");
953 Gdiplus::GdiplusStartupInput gdiplusStartupInput;
1037 {
L".jpg", Gdiplus::ImageFormatJPEG},
1038 {
L".png", Gdiplus::ImageFormatPNG},
1039 {
L".bmp", Gdiplus::ImageFormatBMP},
1040 {
L".gif", Gdiplus::ImageFormatGIF},
1041 {
L".tif", Gdiplus::ImageFormatTIFF},
1042 {
L".jpeg", Gdiplus::ImageFormatJPEG},
1043 {
L".jpe", Gdiplus::ImageFormatJPEG},
1044 {
L".jfif", Gdiplus::ImageFormatJPEG},
1045 {
L".dib", Gdiplus::ImageFormatBMP},
1046 {
L".rle", Gdiplus::ImageFormatBMP},
1047 {
L".tiff", Gdiplus::ImageFormatTIFF}
1068 {Gdiplus::ImageFormatJPEG,
L"image/jpeg"},
1069 {Gdiplus::ImageFormatPNG,
L"image/png"},
1070 {Gdiplus::ImageFormatBMP,
L"image/bmp"},
1071 {Gdiplus::ImageFormatGIF,
L"image/gif"},
1072 {Gdiplus::ImageFormatTIFF,
L"image/tiff"}
1093 if (total_size == 0)
1096 Gdiplus::ImageCodecInfo *pInfo;
1099 pInfo =
reinterpret_cast<Gdiplus::ImageCodecInfo *
>(pb);
1105 for (
UINT iInfo = 0; iInfo <
count; ++iInfo)
1109 *
clsid = pInfo[iInfo].Clsid;
1178 if (nBPP == 16 || nBPP == 32)
1182 pdwMask[0] = pdwBitmasks[0];
1183 pdwMask[1] = pdwBitmasks[1];
1184 pdwMask[2] = pdwBitmasks[2];
1224#ifndef _ATL_NO_AUTOMATIC_NAMESPACE
static CREATEBITMAPFROMFILE CreateBitmapFromFile
BOOL BitBlt(HDC hDestDC, const RECT &rectDest, const POINT &pointSrc, DWORD dwROP=SRCCOPY) const
const GUID * FileTypeFromExtension(LPCWSTR pszExt) const
BOOL Draw(HDC hDestDC, int xDest, int yDest) const
DIBOrientation m_eOrientation
void Attach(HBITMAP hBitmap, DIBOrientation eOrientation=DIBOR_DEFAULT)
BOOL Create(int nWidth, int nHeight, int nBPP, DWORD dwFlags=0)
BOOL MaskBlt(HDC hDestDC, int xDest, int yDest, HBITMAP hbmMask, DWORD dwROP=SRCCOPY) const
BOOL MaskBlt(HDC hDestDC, const POINT &pointDest, HBITMAP hbmMask, DWORD dwROP=SRCCOPY) const
void LoadFromResource(HINSTANCE hInstance, LPCTSTR pszResourceName)
BOOL BitBlt(HDC hDestDC, int xDest, int yDest, DWORD dwROP=SRCCOPY) const
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
HRESULT Load(LPCTSTR pszFileName)
void SetPixelRGB(int x, int y, BYTE r, BYTE g, BYTE b)
HRESULT Save(IStream *pStream, GUID *guidFileType) const
BOOL AlphaBlend(HDC hDestDC, const POINT &pointDest, BYTE bSrcAlpha=0xFF, BYTE bBlendOp=AC_SRC_OVER) const
BOOL Draw(HDC hDestDC, const POINT &pointDest) const
BOOL CreateEx(int nWidth, int nHeight, int nBPP, DWORD eCompression, const DWORD *pdwBitmasks=NULL, DWORD dwFlags=0)
int GetMaxColorTableEntries() const
HRESULT Save(LPCTSTR pszFileName, REFGUID guidFileType=GUID_NULL) const
static HRESULT GetImporterFilterString(CSimpleString &strImporters, CSimpleArray< GUID > &aguidFileTypes, LPCTSTR pszAllFilesDescription=NULL, DWORD dwExclude=excludeDefaultLoad, TCHAR chSeparator=TEXT('|'))
BOOL StretchBlt(HDC hDestDC, int xDest, int yDest, int nDestWidth, int nDestHeight, DWORD dwROP=SRCCOPY) const
HRESULT Load(IStream *pStream)
BOOL BitBlt(HDC hDestDC, int xDest, int yDest, int nDestWidth, int nDestHeight, int xSrc, int ySrc, DWORD dwROP=SRCCOPY) const
BOOL CreateInternal(int nWidth, int nHeight, int nBPP, DWORD eCompression, const DWORD *pdwBitmasks=NULL, DWORD dwFlags=0)
bool GetClsidFromFileType(CLSID *clsid, const GUID *guid) const
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
BOOL TransparentBlt(HDC hDestDC, int xDest, int yDest, int nDestWidth, int nDestHeight, UINT crTransparent=CLR_INVALID) const
void GetColorTable(UINT iFirstColor, UINT nColors, RGBQUAD *prgbColors) const
void SetColorTable(UINT iFirstColor, UINT nColors, const RGBQUAD *prgbColors)
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
BOOL Draw(HDC hDestDC, const RECT &rectDest) const
BOOL Draw(HDC hDestDC, int xDest, int yDest, int nDestWidth, int nDestHeight) const
BOOL StretchBlt(HDC hDestDC, const RECT &rectDest, DWORD dwROP=SRCCOPY) const
BOOL StretchBlt(HDC hDestDC, const RECT &rectDest, const RECT &rectSrc, DWORD dwROP=SRCCOPY) const
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
BOOL TransparentBlt(HDC hDestDC, const RECT &rectDest, UINT crTransparent=CLR_INVALID) const
BOOL PlgBlt(HDC hDestDC, const POINT *pPoints, const RECT &rectSrc, HBITMAP hbmMask, const POINT &pointMask) const
static HRESULT GetCommonFilterString(CSimpleString &strFilter, CSimpleArray< GUID > &aguidFileTypes, LPCTSTR pszAllFilesDescription, DWORD dwExclude, TCHAR chSeparator)
BOOL PlgBlt(HDC hDestDC, const POINT *pPoints, HBITMAP hbmMask=NULL) const
COLORREF GetTransparentColor() const
LPCWSTR GetFileExtension(LPCWSTR pszFileName) const
static COMMON *& GetCommonPtr()
static HRESULT GetExporterFilterString(CSimpleString &strExporters, CSimpleArray< GUID > &aguidFileTypes, LPCTSTR pszAllFilesDescription=NULL, DWORD dwExclude=excludeDefaultSave, TCHAR chSeparator=TEXT('|'))
static COMMON & GetCommon()
void AttachInternal(HBITMAP hBitmap, DIBOrientation eOrientation, LONG iTransColor)
bool IsDIBSection() const
int GetEncoderClsid(LPCWSTR mime, CLSID *clsid) const
BOOL AlphaBlend(HDC hDestDC, const RECT &rectDest, const RECT &rectSrc, BYTE bSrcAlpha=0xFF, BYTE bBlendOp=AC_SRC_OVER) const
BOOL MaskBlt(HDC hDestDC, const RECT &rectDest, const POINT &pointSrc, HBITMAP hbmMask, const POINT &pointMask, DWORD dwROP=SRCCOPY) const
COLORREF SetTransparentColor(COLORREF rgbTransparent)
bool IsGuidEqual(const GUID &guid1, const GUID &guid2) const
BOOL TransparentBlt(HDC hDestDC, const RECT &rectDest, const RECT &rectSrc, UINT crTransparent=CLR_INVALID) const
void LoadFromResource(HINSTANCE hInstance, UINT nIDResource)
BOOL BitBlt(HDC hDestDC, const POINT &pointDest, DWORD dwROP=SRCCOPY) const
COLORREF RGBFromPaletteIndex(int iIndex) const
void SetPixel(int x, int y, COLORREF color)
BOOL StretchBlt(HDC hDestDC, int xDest, int yDest, int nDestWidth, int nDestHeight, int xSrc, int ySrc, int nSrcWidth, int nSrcHeight, DWORD dwROP=SRCCOPY) const
COLORREF GetPixel(int x, int y) const
CImage & operator=(const CImage &)
BOOL PlgBlt(HDC hDestDC, const POINT *pPoints, const RECT &rectSrc, HBITMAP hbmMask=NULL) const
BOOL Draw(HDC hDestDC, const RECT &rectDest, const RECT &rectSrc) const
void * GetPixelAddress(int x, int y)
static BOOL IsTransparencySupported()
BOOL Draw(HDC hDestDC, int xDest, int yDest, int nDestWidth, int nDestHeight, int xSrc, int ySrc, int nSrcWidth, int nSrcHeight) const
BOOL AlphaBlend(HDC hDestDC, int xDest, int yDest, BYTE bSrcAlpha=0xFF, BYTE bBlendOp=AC_SRC_OVER) const
void SetPixelIndexed(int x, int y, int iIndex)
#define GetProcAddress(x, y)
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
GLint GLint GLint GLint GLint x
GLint GLint GLint GLint GLint GLint y
GLuint GLuint GLsizei count
GLint GLint GLsizei GLsizei height
GLdouble GLdouble GLdouble r
GLint GLint GLsizei width
GLboolean GLboolean GLboolean b
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
int WINAPI lstrcmpiW(LPCWSTR lpString1, LPCWSTR lpString2)
static ULONG WINAPI AddRef(IStream *iface)
static void quad(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3, GLuint pv)
int WINAPI UuidEqual(UUID *Uuid1, UUID *Uuid2, RPC_STATUS *Status)
TYPE AddrOf(const char *name)
DISPOSEIMAGE DisposeImage
Gdiplus::GdiplusStartupOutput GSO
St(API * GETIMAGEENCODERS)(UINT, UINT, ICI *)
GETIMAGEENCODERS GetImageEncoders
Gdiplus::GdiplusStartupInput GSI
St(API * CREATEBITMAPFROMHBITMAP)(HBM, HPALETTE, Bm **)
Gdiplus::ImageCodecInfo ICI
St(API * SAVEIMAGETOFILE)(Im *, CST WCHAR *, CST CLSID *, CST EncParams *)
SAVEIMAGETOFILE SaveImageToFile
St(WINAPI * STARTUP)(ULONG_PTR *, const GSI *, GSO *)
St(API * CREATEHBITMAPFROMBITMAP)(Bm *, HBM *, ARGB)
CREATEBITMAPFROMFILE CreateBitmapFromFile
St(API * CREATEBITMAPFROMFILE)(CST WCHAR *, Bm **)
St(API * CREATEBITMAPFROMSTREAM)(IStream *, Bm **)
void(WINAPI * SHUTDOWN)(ULONG_PTR)
CREATEHBITMAPFROMBITMAP CreateHBITMAPFromBitmap
SAVEIMAGETOSTREAM SaveImageToStream
St(API * SAVEIMAGETOSTREAM)(Im *, IStream *, CST CLSID *, CST EncParams *)
CREATEBITMAPFROMSTREAM CreateBitmapFromStream
GETIMAGEENCODERSSIZE GetImageEncodersSize
St(API * DISPOSEIMAGE)(Im *)
Gdiplus::EncoderParameters EncParams
CREATEBITMAPFROMHBITMAP CreateBitmapFromHBITMAP
St(API * GETIMAGEENCODERSSIZE)(UINT *, UINT *)
BITMAPINFOHEADER bmiHeader
const BITMAPINFO * get() const
WORD WORD PSZ PSZ pszFileName
_In_ WDFDEVICE _In_ WDF_SPECIAL_FILE_TYPE FileType
HBITMAP WINAPI CreateDIBSection(HDC hDC, CONST BITMAPINFO *BitmapInfo, UINT Usage, VOID **Bits, HANDLE hSection, DWORD dwOffset)
UINT WINAPI GetDIBColorTable(HDC hDC, UINT iStartIndex, UINT cEntries, RGBQUAD *pColors)
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
_In_ SURFOBJ _In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ RECTL _In_ RECTL _In_ ULONG iTransColor
_In_ ULONG _In_ ULONG rgb
struct tagDIBSECTION DIBSECTION
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
UINT WINAPI SetDIBColorTable(_In_ HDC hdc, _In_ UINT iStart, _In_ UINT cEntries, _In_reads_(cEntries) const RGBQUAD *prgbq)
BOOL WINAPI SetPixelV(_In_ HDC, _In_ int, _In_ int, _In_ COLORREF)
BOOL WINAPI DeleteDC(_In_ HDC)
#define LR_CREATEDIBSECTION