12namespace GPDE = Gdiplus::DllExports;
49 if (!
get_fn(
_shared()->m_GetImageHorizontalResolution,
"GdipGetImageHorizontalResolution") ||
50 !
get_fn(
_shared()->m_GetImageVerticalResolution,
"GdipGetImageVerticalResolution"))
65 if (!
get_fn(
_shared()->m_BitmapSetResolution,
"GdipBitmapSetResolution"))
74 using namespace Gdiplus;
78 if (!
get_fn(
_shared()->m_CreateBitmapFromFile,
"GdipCreateBitmapFromFile") ||
79 !
get_fn(
_shared()->m_CreateHBITMAPFromBitmap,
"GdipCreateHBITMAPFromBitmap") ||
115 float xDpi = 0,
float yDpi = 0) throw()
117 using namespace Gdiplus;
121 if (!
get_fn(
_shared()->m_CreateBitmapFromHBITMAP,
"GdipCreateBitmapFromHBITMAP") ||
122 !
get_fn(
_shared()->m_SaveImageToFile,
"GdipSaveImageToFile") ||
229 Gdiplus::GdiplusStartupInput gdiplusStartupInput;
265 Gdiplus::ImageCodecInfo *
ret =
NULL;
268 if (!
get_fn(
_shared()->m_GetImageEncodersSize,
"GdipGetImageEncodersSize") ||
269 !
get_fn(
_shared()->m_GetImageEncoders,
"GdipGetImageEncoders"))
279 ret =
new Gdiplus::ImageCodecInfo[total_size /
sizeof(
ret[0])];
291 template <
typename FN_T>
305 for (
UINT i = 0;
i < nCodecs; ++
i)
307 CStringW strSpecs(pCodecs[
i].FilenameExtension);
308 int ichOld = 0, ichSep;
311 ichSep = strSpecs.
Find(
L';', ichOld);
315 strSpec = strSpecs.
Mid(ichOld);
317 strSpec = strSpecs.
Mid(ichOld, ichSep - ichOld);
321 strSpec = strSpec.
Mid(ichDot);
324 return pCodecs[
i].Clsid;
339 for (
UINT iInfo = 0; iInfo < nCodecs; ++iInfo)
342 return pCodecs[iInfo].Clsid;
int CompareNoCase(_In_z_ PCXSTR psz) const
int Find(_In_ PCXSTR pszSub, _In_opt_ int iStart=0) const noexcept
CStringT Mid(int iFirst, int nCount) const
int ReverseFind(_In_ XCHAR ch) const noexcept
decltype(&GPDE::GdipGetImageEncoders) FN_GetImageEncoders
decltype(&GPDE::GdipGetImageHorizontalResolution) FN_GetImageHorizontalResolution
HRESULT SaveDx(LPCWSTR pszFileName, REFGUID guidFileType=GUID_NULL, float xDpi=0, float yDpi=0)
decltype(&GPDE::GdipGetImageVerticalResolution) FN_GetImageVerticalResolution
decltype(&GPDE::GdipDisposeImage) FN_DisposeImage
static BOOL IsExtensionSupported(PWCHAR pchDotExt)
decltype(&GPDE::GdipGetImageEncodersSize) FN_GetImageEncodersSize
HRESULT LoadDx(LPCWSTR pszFileName, float *pxDpi, float *pyDpi)
BOOL GetResolution(Gdiplus::GpImage *pImage, float *pxDpi, float *pyDpi)
static Gdiplus::ImageCodecInfo * GetAllEncoders(UINT &cEncoders)
BOOL SetResolution(Gdiplus::GpBitmap *pBitmap, float xDpi, float yDpi)
decltype(&Gdiplus::GdiplusStartup) FN_Startup
decltype(&Gdiplus::GdiplusShutdown) FN_Shutdown
decltype(&GPDE::GdipBitmapSetResolution) FN_BitmapSetResolution
static bool get_fn(FN_T &fn, const char *name)
decltype(&GPDE::GdipCreateHBITMAPFromBitmap) FN_CreateHBITMAPFromBitmap
decltype(&GPDE::GdipCreateBitmapFromHBITMAP) FN_CreateBitmapFromHBITMAP
static CLSID FindCodecForFileType(REFGUID guidFileType, const Gdiplus::ImageCodecInfo *pCodecs, UINT nCodecs)
static CLSID FindCodecForExtension(LPCWSTR dotext, const Gdiplus::ImageCodecInfo *pCodecs, UINT nCodecs)
static SHARED * _shared()
decltype(&GPDE::GdipCreateBitmapFromFile) FN_CreateBitmapFromFile
decltype(&GPDE::GdipSaveImageToFile) FN_SaveImageToFile
#define GetProcAddress(x, y)
LPWSTR WINAPI PathFindExtensionW(LPCWSTR lpszPath)
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
#define IsEqualGUID(rguid1, rguid2)
FN_GetImageEncoders m_GetImageEncoders
FN_DisposeImage m_DisposeImage
FN_CreateBitmapFromHBITMAP m_CreateBitmapFromHBITMAP
FN_CreateBitmapFromFile m_CreateBitmapFromFile
FN_GetImageHorizontalResolution m_GetImageHorizontalResolution
FN_BitmapSetResolution m_BitmapSetResolution
FN_GetImageEncodersSize m_GetImageEncodersSize
FN_GetImageVerticalResolution m_GetImageVerticalResolution
FN_CreateHBITMAPFromBitmap m_CreateHBITMAPFromBitmap
FN_SaveImageToFile m_SaveImageToFile
WORD WORD PSZ PSZ pszFileName
static GLenum _GLUfuncptr fn
_In_ BOOLEAN SetResolution