160 ok(!image1.
IsNull(),
"Expected image1 is not null\n");
163 ok(
width == 48,
"Expected width to be 48, was: %d\n",
width);
167 ok(
bpp == 8,
"Expected bpp to be 8, was: %d\n",
bpp);
171 ok(!image2.
IsNull(),
"Expected image2 is not null\n");
175 ok(
width == 32,
"Expected width to be 32, was: %d\n",
width);
179 ok(
bpp == 8,
"Expected bpp to be 8, was: %d\n",
bpp);
182 ok(
color ==
RGB(166, 202, 240),
"Expected color to be 166, 202, 240; was: %i, %i, %i\n",
GetRValue(
color),
GetGValue(
color),
GetBValue(
color));
187 ok(bOK !=
FALSE,
"Expected bDraw to be TRUE, was: %d\n", bOK);
191 ok(
color ==
RGB(255, 0,0),
"Expected color to be 255, 0, 0; was: %i, %i, %i\n",
GetRValue(
color),
GetGValue(
color),
GetBValue(
color));
201 ok(
hr ==
S_OK,
"Expected hr to be S_OK, was: %08lx\n",
hr);
202 ok(!image2.
IsNull(),
"Expected image1 is not null\n");
204 ok(bOK,
"Expected bOK to be TRUE, was: %d\n", bOK);
219 hr = image1.
Save(
file, Gdiplus::ImageFormatPNG);
222 ok(
hr ==
S_OK,
"Expected hr to be S_OK, was: %08lx (for %i)\n",
hr,
n);
225 ok(bOK,
"Expected bOK to be TRUE, was: %d (for %i)\n", bOK,
n);
228 ok(
hr ==
S_OK,
"Expected hr to be S_OK, was: %08lx (for %i)\n",
hr,
n);
231 ok(
width == 48,
"Expected width to be 48, was: %d (for %i)\n",
width,
n);
233 ok(
height == 48,
"Expected height to be 48, was: %d (for %i)\n",
height,
n);
237 ok(
bpp == 32,
"Expected bpp to be 32, was: %d (for %i)\n",
bpp,
n);
242 ok(
bpp == 32,
"Expected bpp to be 32, was: %d (for %i)\n",
bpp,
n);
246 ok(
color ==
RGB(255, 0,0),
"Expected color to be 255, 0, 0; was: %i, %i, %i (for %i)\n",
GetRValue(
color),
GetGValue(
color),
GetBValue(
color),
n);
249 ok(bOK,
"Expected bOK to be TRUE, was: %d (for %i)\n", bOK,
n);
262 aguidFileTypes.RemoveAll();
263 hr = CImage::GetImporterFilterString(strImporters,
265 TEXT(
"All Image Files"), 0);
266 ok(
hr ==
S_OK,
"Expected hr to be S_OK, was: %ld\n",
hr);
267 ok(aguidFileTypes.GetSize() == 9,
"Expected aguidFileTypes.GetSize() to be 8, was %d.", aguidFileTypes.GetSize());
269 ok(
IsEqualGUID(aguidFileTypes[1], Gdiplus::ImageFormatBMP),
"Expected aguidFileTypes[1] to be Gdiplus::ImageFormatBMP.\n");
270 ok(
IsEqualGUID(aguidFileTypes[2], Gdiplus::ImageFormatJPEG),
"Expected aguidFileTypes[2] to be Gdiplus::ImageFormatJPEG.\n");
271 ok(
IsEqualGUID(aguidFileTypes[3], Gdiplus::ImageFormatGIF),
"Expected aguidFileTypes[3] to be Gdiplus::ImageFormatGIF.\n");
272 ok(
IsEqualGUID(aguidFileTypes[4], Gdiplus::ImageFormatEMF),
"Expected aguidFileTypes[4] to be Gdiplus::ImageFormatEMF.\n");
273 ok(
IsEqualGUID(aguidFileTypes[5], Gdiplus::ImageFormatWMF),
"Expected aguidFileTypes[5] to be Gdiplus::ImageFormatWMF.\n");
274 ok(
IsEqualGUID(aguidFileTypes[6], Gdiplus::ImageFormatTIFF),
"Expected aguidFileTypes[6] to be Gdiplus::ImageFormatTIFF.\n");
275 ok(
IsEqualGUID(aguidFileTypes[7], Gdiplus::ImageFormatPNG),
"Expected aguidFileTypes[7] to be Gdiplus::ImageFormatPNG.\n");
276 ok(
IsEqualGUID(aguidFileTypes[8], Gdiplus::ImageFormatIcon),
"Expected aguidFileTypes[8] to be Gdiplus::ImageFormatIcon.\n");
278 psz = strImporters.GetString();
281 ok(
lstrcmpA(szBuff,
"All Image Files|*.BMP;*.DIB;*.RLE;*.JPG;*.JPEG;*.JPE;*.JFIF;*.GIF;*.EMF;*.WMF;*.TIF;*.TIFF;*.PNG;*.ICO|BMP (*.BMP;*.DIB;*.RLE)|*.BMP;*.DIB;*.RLE|JPEG (*.JPG;*.JPEG;*.JPE;*.JFIF)|*.JPG;*.JPEG;*.JPE;*.JFIF|GIF (*.GIF)|*.GIF|EMF (*.EMF)|*.EMF|WMF (*.WMF)|*.WMF|TIFF (*.TIF;*.TIFF)|*.TIF;*.TIFF|PNG (*.PNG)|*.PNG|ICO (*.ICO)|*.ICO||") == 0,
282 "The importer filter string is bad, was: %s\n", szBuff);
284 ok(
lstrcmpA(psz,
"All Image Files|*.BMP;*.DIB;*.RLE;*.JPG;*.JPEG;*.JPE;*.JFIF;*.GIF;*.EMF;*.WMF;*.TIF;*.TIFF;*.PNG;*.ICO|BMP (*.BMP;*.DIB;*.RLE)|*.BMP;*.DIB;*.RLE|JPEG (*.JPG;*.JPEG;*.JPE;*.JFIF)|*.JPG;*.JPEG;*.JPE;*.JFIF|GIF (*.GIF)|*.GIF|EMF (*.EMF)|*.EMF|WMF (*.WMF)|*.WMF|TIFF (*.TIF;*.TIFF)|*.TIF;*.TIFF|PNG (*.PNG)|*.PNG|ICO (*.ICO)|*.ICO||") == 0,
285 "The importer filter string is bad, was: %s\n", psz);
289 aguidFileTypes.RemoveAll();
290 hr = CImage::GetExporterFilterString(strExporters,
292 TEXT(
"All Image Files"), 0);
293 ok(
hr ==
S_OK,
"Expected hr to be S_OK, was: %ld\n",
hr);
294 ok(aguidFileTypes.GetSize() == 9,
"Expected aguidFileTypes.GetSize() to be 8, was %d.", aguidFileTypes.GetSize());
296 ok(
IsEqualGUID(aguidFileTypes[1], Gdiplus::ImageFormatBMP),
"Expected aguidFileTypes[1] to be Gdiplus::ImageFormatBMP.\n");
297 ok(
IsEqualGUID(aguidFileTypes[2], Gdiplus::ImageFormatJPEG),
"Expected aguidFileTypes[2] to be Gdiplus::ImageFormatJPEG.\n");
298 ok(
IsEqualGUID(aguidFileTypes[3], Gdiplus::ImageFormatGIF),
"Expected aguidFileTypes[3] to be Gdiplus::ImageFormatGIF.\n");
299 ok(
IsEqualGUID(aguidFileTypes[4], Gdiplus::ImageFormatEMF),
"Expected aguidFileTypes[4] to be Gdiplus::ImageFormatEMF.\n");
300 ok(
IsEqualGUID(aguidFileTypes[5], Gdiplus::ImageFormatWMF),
"Expected aguidFileTypes[5] to be Gdiplus::ImageFormatWMF.\n");
301 ok(
IsEqualGUID(aguidFileTypes[6], Gdiplus::ImageFormatTIFF),
"Expected aguidFileTypes[6] to be Gdiplus::ImageFormatTIFF.\n");
302 ok(
IsEqualGUID(aguidFileTypes[7], Gdiplus::ImageFormatPNG),
"Expected aguidFileTypes[7] to be Gdiplus::ImageFormatPNG.\n");
303 ok(
IsEqualGUID(aguidFileTypes[8], Gdiplus::ImageFormatIcon),
"Expected aguidFileTypes[8] to be Gdiplus::ImageFormatIcon.\n");
305 psz = strExporters.GetString();
308 ok(
lstrcmpA(szBuff,
"All Image Files|*.BMP;*.DIB;*.RLE;*.JPG;*.JPEG;*.JPE;*.JFIF;*.GIF;*.EMF;*.WMF;*.TIF;*.TIFF;*.PNG;*.ICO|BMP (*.BMP;*.DIB;*.RLE)|*.BMP;*.DIB;*.RLE|JPEG (*.JPG;*.JPEG;*.JPE;*.JFIF)|*.JPG;*.JPEG;*.JPE;*.JFIF|GIF (*.GIF)|*.GIF|EMF (*.EMF)|*.EMF|WMF (*.WMF)|*.WMF|TIFF (*.TIF;*.TIFF)|*.TIF;*.TIFF|PNG (*.PNG)|*.PNG|ICO (*.ICO)|*.ICO||") == 0,
309 "The exporter filter string is bad, was: %s\n", szBuff);
311 ok(
lstrcmpA(psz,
"All Image Files|*.BMP;*.DIB;*.RLE;*.JPG;*.JPEG;*.JPE;*.JFIF;*.GIF;*.EMF;*.WMF;*.TIF;*.TIFF;*.PNG;*.ICO|BMP (*.BMP;*.DIB;*.RLE)|*.BMP;*.DIB;*.RLE|JPEG (*.JPG;*.JPEG;*.JPE;*.JFIF)|*.JPG;*.JPEG;*.JPE;*.JFIF|GIF (*.GIF)|*.GIF|EMF (*.EMF)|*.EMF|WMF (*.WMF)|*.WMF|TIFF (*.TIF;*.TIFF)|*.TIF;*.TIFF|PNG (*.PNG)|*.PNG|ICO (*.ICO)|*.ICO||") == 0,
312 "The exporter filter string is bad, was: %s\n", psz);
TCHAR * file_name(const TCHAR *file)
GLint GLint GLsizei width
#define WideCharToMultiByte
int WINAPI lstrcmpA(LPCSTR lpString1, LPCSTR lpString2)
VOID WINAPI GetInstance(LPSPropValue, LPSPropValue, ULONG)
void LoadFromResource(HINSTANCE hInstance, LPCTSTR pszResourceName)
HRESULT Load(LPCTSTR pszFileName)
static void determine_file_bpp(TCHAR *tfile, Gdiplus::PixelFormat expect_pf)
BOOL Draw(HDC hDestDC, int xDest, int yDest, int nDestWidth, int nDestHeight, int xSrc, int ySrc, int nSrcWidth, int nSrcHeight) const
#define ok_int(expression, result)
static TCHAR szTempPath[MAX_PATH]
COLORREF SetTransparentColor(COLORREF rgbTransparent)
HRESULT Save(IStream *pStream, GUID *guidFileType) const
static void write_bitmap(HINSTANCE hInst, int id, TCHAR *file)
#define GetFileAttributes
GLint GLint GLsizei GLsizei height
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
COLORREF GetPixel(int x, int y) const