140{
149
150#if 0
154#endif
155
158
160 ok(!image1.
IsNull(),
"Expected image1 is not null\n");
161
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);
168
169
171 ok(!image2.
IsNull(),
"Expected image2 is not null\n");
173
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);
180
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));
183
187 ok(bOK !=
FALSE,
"Expected bDraw to be TRUE, was: %d\n", bOK);
189
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));
192
195
197
199
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);
205
212
214 {
217
219 hr = image1.
Save(
file, Gdiplus::ImageFormatPNG);
220 else
222 ok(
hr ==
S_OK,
"Expected hr to be S_OK, was: %08lx (for %i)\n",
hr,
n);
223
225 ok(bOK,
"Expected bOK to be TRUE, was: %d (for %i)\n", bOK,
n);
226
228 ok(
hr ==
S_OK,
"Expected hr to be S_OK, was: %08lx (for %i)\n",
hr,
n);
229
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);
236 {
237 ok(
bpp == 32,
"Expected bpp to be 32, was: %d (for %i)\n",
bpp,
n);
239 }
240 else
241 {
242 ok(
bpp == 32,
"Expected bpp to be 32, was: %d (for %i)\n",
bpp,
n);
244 }
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);
247
249 ok(bOK,
"Expected bOK to be TRUE, was: %d (for %i)\n", bOK,
n);
250 }
251
254#ifdef UNICODE
257#else
259#endif
260
262 aguidFileTypes.RemoveAll();
264 aguidFileTypes,
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");
277
278 psz = strImporters.GetString();
279#ifdef UNICODE
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);
283#else
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);
286#endif
287
289 aguidFileTypes.RemoveAll();
291 aguidFileTypes,
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");
304
305 psz = strExporters.GetString();
306#ifdef UNICODE
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);
310#else
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);
313#endif
314}
static void determine_file_bpp(TCHAR *tfile, Gdiplus::PixelFormat expect_pf)
static void write_bitmap(HINSTANCE hInst, int id, TCHAR *file)
#define ok_int(expression, result)
static IAtlStringMgr * GetInstance(void)
void LoadFromResource(HINSTANCE hInstance, LPCTSTR pszResourceName)
HRESULT Load(LPCTSTR pszFileName)
HRESULT Save(IStream *pStream, GUID *guidFileType) const
static HRESULT GetImporterFilterString(CSimpleString &strImporters, CSimpleArray< GUID > &aguidFileTypes, LPCTSTR pszAllFilesDescription=NULL, DWORD dwExclude=excludeDefaultLoad, TCHAR chSeparator=TEXT('|'))
static HRESULT GetExporterFilterString(CSimpleString &strExporters, CSimpleArray< GUID > &aguidFileTypes, LPCTSTR pszAllFilesDescription=NULL, DWORD dwExclude=excludeDefaultSave, TCHAR chSeparator=TEXT('|'))
COLORREF SetTransparentColor(COLORREF rgbTransparent)
COLORREF GetPixel(int x, int y) const
BOOL Draw(HDC hDestDC, int xDest, int yDest, int nDestWidth, int nDestHeight, int xSrc, int ySrc, int nSrcWidth, int nSrcHeight) const
#define WideCharToMultiByte
GLint GLint GLsizei GLsizei height
GLint GLint GLsizei width
int WINAPI lstrcmpA(LPCSTR lpString1, LPCSTR lpString2)
#define IsEqualGUID(rguid1, rguid2)
#define GetFileAttributes