2007-08-09 04:42:20 +02:00
|
|
|
/*
|
|
|
|
* Unit test suite for images
|
|
|
|
*
|
|
|
|
* Copyright (C) 2007 Google (Evan Stade)
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "windows.h"
|
|
|
|
#include "gdiplus.h"
|
|
|
|
#include "wine/test.h"
|
2008-02-27 10:36:44 +01:00
|
|
|
#include <math.h>
|
2008-03-22 00:39:22 +01:00
|
|
|
#include "wingdi.h"
|
2007-08-09 04:42:20 +02:00
|
|
|
|
|
|
|
#define expect(expected, got) ok(((UINT)got) == ((UINT)expected), "Expected %.8x, got %.8x\n", (UINT)expected, (UINT)got)
|
|
|
|
|
2007-08-29 21:42:28 +02:00
|
|
|
static void test_Scan0(void)
|
2007-08-09 04:42:20 +02:00
|
|
|
{
|
|
|
|
GpBitmap *bm;
|
|
|
|
GpStatus stat;
|
|
|
|
BYTE buff[360];
|
|
|
|
|
|
|
|
bm = NULL;
|
|
|
|
stat = GdipCreateBitmapFromScan0(10, 10, 10, PixelFormat24bppRGB, NULL, &bm);
|
2007-08-09 04:42:24 +02:00
|
|
|
expect(Ok, stat);
|
|
|
|
ok(NULL != bm, "Expected bitmap to be initialized\n");
|
2008-01-14 02:42:28 +01:00
|
|
|
if (stat == Ok)
|
|
|
|
GdipDisposeImage((GpImage*)bm);
|
2007-08-09 04:42:20 +02:00
|
|
|
|
|
|
|
bm = (GpBitmap*)0xdeadbeef;
|
|
|
|
stat = GdipCreateBitmapFromScan0(10, -10, 10, PixelFormat24bppRGB, NULL, &bm);
|
|
|
|
expect(InvalidParameter, stat);
|
2007-08-09 04:42:24 +02:00
|
|
|
|
|
|
|
expect(NULL, bm);
|
2007-08-09 04:42:20 +02:00
|
|
|
|
|
|
|
bm = (GpBitmap*)0xdeadbeef;
|
|
|
|
stat = GdipCreateBitmapFromScan0(-10, 10, 10, PixelFormat24bppRGB, NULL, &bm);
|
|
|
|
expect(InvalidParameter, stat);
|
2007-08-09 04:42:24 +02:00
|
|
|
|
|
|
|
expect(NULL, bm);
|
2007-08-09 04:42:20 +02:00
|
|
|
|
|
|
|
bm = (GpBitmap*)0xdeadbeef;
|
|
|
|
stat = GdipCreateBitmapFromScan0(10, 0, 10, PixelFormat24bppRGB, NULL, &bm);
|
|
|
|
expect(InvalidParameter, stat);
|
2007-08-09 04:42:24 +02:00
|
|
|
|
|
|
|
expect(NULL, bm);
|
2007-08-09 04:42:20 +02:00
|
|
|
|
|
|
|
bm = NULL;
|
|
|
|
stat = GdipCreateBitmapFromScan0(10, 10, 12, PixelFormat24bppRGB, buff, &bm);
|
|
|
|
expect(Ok, stat);
|
|
|
|
ok(NULL != bm, "Expected bitmap to be initialized\n");
|
2008-01-14 02:42:28 +01:00
|
|
|
if (stat == Ok)
|
|
|
|
GdipDisposeImage((GpImage*)bm);
|
2007-08-09 04:42:20 +02:00
|
|
|
|
|
|
|
bm = (GpBitmap*) 0xdeadbeef;
|
|
|
|
stat = GdipCreateBitmapFromScan0(10, 10, 10, PixelFormat24bppRGB, buff, &bm);
|
2007-08-09 04:42:24 +02:00
|
|
|
expect(InvalidParameter, stat);
|
|
|
|
expect(NULL, bm);
|
2007-08-09 04:42:20 +02:00
|
|
|
|
|
|
|
bm = (GpBitmap*)0xdeadbeef;
|
|
|
|
stat = GdipCreateBitmapFromScan0(10, 10, 0, PixelFormat24bppRGB, buff, &bm);
|
2007-08-09 04:42:24 +02:00
|
|
|
expect(InvalidParameter, stat);
|
|
|
|
expect(0xdeadbeef, bm);
|
2007-08-09 04:42:20 +02:00
|
|
|
}
|
|
|
|
|
2008-02-27 10:36:44 +01:00
|
|
|
static void test_GetImageDimension(void)
|
|
|
|
{
|
|
|
|
GpBitmap *bm;
|
|
|
|
GpStatus stat;
|
|
|
|
const REAL WIDTH = 10.0, HEIGHT = 20.0;
|
|
|
|
REAL w,h;
|
|
|
|
|
|
|
|
bm = (GpBitmap*)0xdeadbeef;
|
|
|
|
stat = GdipCreateBitmapFromScan0(WIDTH, HEIGHT, 0, PixelFormat24bppRGB,NULL, &bm);
|
|
|
|
expect(Ok,stat);
|
|
|
|
ok((GpBitmap*)0xdeadbeef != bm, "Expected bitmap to not be 0xdeadbeef\n");
|
|
|
|
ok(NULL != bm, "Expected bitmap to not be NULL\n");
|
|
|
|
|
|
|
|
stat = GdipGetImageDimension(NULL,&w,&h);
|
|
|
|
expect(InvalidParameter, stat);
|
|
|
|
|
|
|
|
stat = GdipGetImageDimension((GpImage*)bm,NULL,&h);
|
|
|
|
expect(InvalidParameter, stat);
|
|
|
|
|
|
|
|
stat = GdipGetImageDimension((GpImage*)bm,&w,NULL);
|
|
|
|
expect(InvalidParameter, stat);
|
|
|
|
|
|
|
|
w = -1;
|
|
|
|
h = -1;
|
|
|
|
stat = GdipGetImageDimension((GpImage*)bm,&w,&h);
|
|
|
|
expect(Ok, stat);
|
2008-03-01 21:13:09 +01:00
|
|
|
ok(fabs(WIDTH - w) < 0.0001, "Width wrong\n");
|
|
|
|
ok(fabs(HEIGHT - h) < 0.0001, "Height wrong\n");
|
2008-02-27 10:36:44 +01:00
|
|
|
GdipDisposeImage((GpImage*)bm);
|
|
|
|
}
|
|
|
|
|
2008-02-24 16:41:28 +01:00
|
|
|
static void test_LoadingImages(void)
|
|
|
|
{
|
|
|
|
GpStatus stat;
|
|
|
|
|
|
|
|
stat = GdipCreateBitmapFromFile(0, 0);
|
|
|
|
expect(InvalidParameter, stat);
|
|
|
|
|
|
|
|
stat = GdipCreateBitmapFromFile(0, (GpBitmap**)0xdeadbeef);
|
|
|
|
expect(InvalidParameter, stat);
|
2008-02-24 16:41:29 +01:00
|
|
|
|
|
|
|
stat = GdipLoadImageFromFile(0, 0);
|
|
|
|
expect(InvalidParameter, stat);
|
|
|
|
|
|
|
|
stat = GdipLoadImageFromFile(0, (GpImage**)0xdeadbeef);
|
|
|
|
expect(InvalidParameter, stat);
|
2008-02-24 16:41:28 +01:00
|
|
|
}
|
|
|
|
|
2008-03-10 16:16:54 +01:00
|
|
|
static void test_SavingImages(void)
|
|
|
|
{
|
|
|
|
GpStatus stat;
|
|
|
|
GpBitmap *bm;
|
|
|
|
UINT n;
|
|
|
|
UINT s;
|
2008-03-10 16:16:57 +01:00
|
|
|
const REAL WIDTH = 10.0, HEIGHT = 20.0;
|
|
|
|
REAL w, h;
|
2008-03-10 16:16:54 +01:00
|
|
|
ImageCodecInfo *codecs;
|
|
|
|
static const WCHAR filename[] = { 'a','.','b','m','p',0 };
|
|
|
|
|
|
|
|
codecs = NULL;
|
|
|
|
|
|
|
|
stat = GdipSaveImageToFile(0, 0, 0, 0);
|
|
|
|
expect(InvalidParameter, stat);
|
|
|
|
|
|
|
|
bm = NULL;
|
2008-03-10 16:16:57 +01:00
|
|
|
stat = GdipCreateBitmapFromScan0(WIDTH, HEIGHT, 0, PixelFormat24bppRGB, NULL, &bm);
|
2008-03-10 16:16:54 +01:00
|
|
|
expect(Ok, stat);
|
|
|
|
if (!bm)
|
|
|
|
return;
|
|
|
|
|
|
|
|
/* invalid params */
|
|
|
|
stat = GdipSaveImageToFile((GpImage*)bm, 0, 0, 0);
|
|
|
|
expect(InvalidParameter, stat);
|
|
|
|
|
|
|
|
stat = GdipSaveImageToFile((GpImage*)bm, filename, 0, 0);
|
|
|
|
expect(InvalidParameter, stat);
|
|
|
|
|
2008-03-10 16:16:57 +01:00
|
|
|
/* encoder tests should succeed -- already tested */
|
2008-03-10 16:16:54 +01:00
|
|
|
stat = GdipGetImageEncodersSize(&n, &s);
|
|
|
|
if (stat != Ok || n == 0) goto cleanup;
|
|
|
|
|
|
|
|
codecs = GdipAlloc(s);
|
|
|
|
if (!codecs) goto cleanup;
|
|
|
|
|
|
|
|
stat = GdipGetImageEncoders(n, s, codecs);
|
|
|
|
if (stat != Ok) goto cleanup;
|
|
|
|
|
2008-03-10 16:16:56 +01:00
|
|
|
stat = GdipSaveImageToFile((GpImage*)bm, filename, &codecs[0].Clsid, 0);
|
|
|
|
expect(stat, Ok);
|
2008-03-10 16:16:54 +01:00
|
|
|
|
2008-03-10 16:16:57 +01:00
|
|
|
GdipDisposeImage((GpImage*)bm);
|
|
|
|
bm = 0;
|
|
|
|
|
|
|
|
/* re-load and check image stats */
|
|
|
|
stat = GdipLoadImageFromFile(filename, (GpImage**)&bm);
|
|
|
|
expect(stat, Ok);
|
|
|
|
if (stat != Ok) goto cleanup;
|
|
|
|
|
|
|
|
stat = GdipGetImageDimension((GpImage*)bm, &w, &h);
|
|
|
|
if (stat != Ok) goto cleanup;
|
|
|
|
|
|
|
|
ok((fabs(w - WIDTH) < 0.01) && (fabs(h - HEIGHT) < 0.01),
|
|
|
|
"Saved image dimensions are different!\n");
|
|
|
|
|
2008-03-10 16:16:54 +01:00
|
|
|
cleanup:
|
2008-03-11 21:08:27 +01:00
|
|
|
GdipFree(codecs);
|
2008-03-10 16:16:54 +01:00
|
|
|
if (bm)
|
|
|
|
GdipDisposeImage((GpImage*)bm);
|
2008-03-10 16:16:57 +01:00
|
|
|
ok(DeleteFileW(filename), "Delete failed.\n");
|
2008-03-10 16:16:54 +01:00
|
|
|
}
|
|
|
|
|
2008-03-06 10:17:00 +01:00
|
|
|
static void test_encoders(void)
|
|
|
|
{
|
|
|
|
GpStatus stat;
|
|
|
|
UINT n;
|
|
|
|
UINT s;
|
|
|
|
ImageCodecInfo *codecs;
|
|
|
|
int i;
|
|
|
|
int bmp_found;
|
|
|
|
|
|
|
|
static const WCHAR bmp_format[] = {'B', 'M', 'P', 0};
|
|
|
|
|
|
|
|
stat = GdipGetImageEncodersSize(&n, &s);
|
|
|
|
expect(stat, Ok);
|
|
|
|
|
|
|
|
codecs = GdipAlloc(s);
|
|
|
|
if (!codecs)
|
|
|
|
return;
|
|
|
|
|
|
|
|
stat = GdipGetImageEncoders(n, s, NULL);
|
|
|
|
expect(GenericError, stat);
|
|
|
|
|
|
|
|
stat = GdipGetImageEncoders(0, s, codecs);
|
|
|
|
expect(GenericError, stat);
|
|
|
|
|
|
|
|
stat = GdipGetImageEncoders(n, s-1, codecs);
|
|
|
|
expect(GenericError, stat);
|
|
|
|
|
|
|
|
stat = GdipGetImageEncoders(n, s+1, codecs);
|
|
|
|
expect(GenericError, stat);
|
|
|
|
|
|
|
|
stat = GdipGetImageEncoders(n, s, codecs);
|
|
|
|
expect(stat, Ok);
|
|
|
|
|
|
|
|
bmp_found = FALSE;
|
|
|
|
for (i = 0; i < n; i++)
|
|
|
|
{
|
|
|
|
if (CompareStringW(LOCALE_SYSTEM_DEFAULT, 0,
|
|
|
|
codecs[i].FormatDescription, -1,
|
|
|
|
bmp_format, -1) == CSTR_EQUAL) {
|
|
|
|
bmp_found = TRUE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!bmp_found)
|
|
|
|
ok(FALSE, "No BMP codec found.\n");
|
|
|
|
|
|
|
|
GdipFree(codecs);
|
|
|
|
}
|
|
|
|
|
2008-03-07 10:19:02 +01:00
|
|
|
static void test_LockBits(void)
|
|
|
|
{
|
|
|
|
GpStatus stat;
|
|
|
|
GpBitmap *bm;
|
|
|
|
GpRect rect;
|
|
|
|
BitmapData bd;
|
|
|
|
const REAL WIDTH = 10.0, HEIGHT = 20.0;
|
|
|
|
|
|
|
|
bm = NULL;
|
|
|
|
stat = GdipCreateBitmapFromScan0(WIDTH, HEIGHT, 0, PixelFormat24bppRGB, NULL, &bm);
|
|
|
|
expect(Ok, stat);
|
|
|
|
|
|
|
|
rect.X = 2;
|
|
|
|
rect.Y = 3;
|
|
|
|
rect.Width = 4;
|
|
|
|
rect.Height = 5;
|
|
|
|
|
|
|
|
/* read-only */
|
|
|
|
stat = GdipBitmapLockBits(bm, &rect, ImageLockModeRead, PixelFormat24bppRGB, &bd);
|
|
|
|
expect(Ok, stat);
|
|
|
|
|
|
|
|
if (stat == Ok) {
|
|
|
|
stat = GdipBitmapUnlockBits(bm, &bd);
|
|
|
|
expect(Ok, stat);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* read-only, consecutive */
|
|
|
|
stat = GdipBitmapLockBits(bm, &rect, ImageLockModeRead, PixelFormat24bppRGB, &bd);
|
|
|
|
expect(Ok, stat);
|
|
|
|
|
|
|
|
if (stat == Ok) {
|
|
|
|
stat = GdipBitmapUnlockBits(bm, &bd);
|
|
|
|
expect(Ok, stat);
|
|
|
|
}
|
|
|
|
|
|
|
|
stat = GdipDisposeImage((GpImage*)bm);
|
|
|
|
expect(Ok, stat);
|
|
|
|
stat = GdipCreateBitmapFromScan0(WIDTH, HEIGHT, 0, PixelFormat24bppRGB, NULL, &bm);
|
|
|
|
expect(Ok, stat);
|
|
|
|
|
|
|
|
/* read x2 */
|
|
|
|
stat = GdipBitmapLockBits(bm, &rect, ImageLockModeRead, PixelFormat24bppRGB, &bd);
|
|
|
|
expect(Ok, stat);
|
2008-03-07 10:19:05 +01:00
|
|
|
stat = GdipBitmapLockBits(bm, &rect, ImageLockModeRead, PixelFormat24bppRGB, &bd);
|
|
|
|
expect(WrongState, stat);
|
2008-03-07 10:19:02 +01:00
|
|
|
|
|
|
|
stat = GdipBitmapUnlockBits(bm, &bd);
|
|
|
|
expect(Ok, stat);
|
|
|
|
|
|
|
|
stat = GdipDisposeImage((GpImage*)bm);
|
|
|
|
expect(Ok, stat);
|
|
|
|
stat = GdipCreateBitmapFromScan0(WIDTH, HEIGHT, 0, PixelFormat24bppRGB, NULL, &bm);
|
|
|
|
expect(Ok, stat);
|
|
|
|
|
|
|
|
/* write, no modification */
|
|
|
|
stat = GdipBitmapLockBits(bm, &rect, ImageLockModeWrite, PixelFormat24bppRGB, &bd);
|
|
|
|
expect(Ok, stat);
|
|
|
|
|
|
|
|
if (stat == Ok) {
|
|
|
|
stat = GdipBitmapUnlockBits(bm, &bd);
|
|
|
|
expect(Ok, stat);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* write, consecutive */
|
2008-03-07 10:19:04 +01:00
|
|
|
stat = GdipBitmapLockBits(bm, &rect, ImageLockModeWrite, PixelFormat24bppRGB, &bd);
|
|
|
|
expect(Ok, stat);
|
2008-03-07 10:19:02 +01:00
|
|
|
|
|
|
|
if (stat == Ok) {
|
|
|
|
stat = GdipBitmapUnlockBits(bm, &bd);
|
|
|
|
expect(Ok, stat);
|
|
|
|
}
|
|
|
|
|
|
|
|
stat = GdipDisposeImage((GpImage*)bm);
|
|
|
|
expect(Ok, stat);
|
|
|
|
stat = GdipCreateBitmapFromScan0(WIDTH, HEIGHT, 0, PixelFormat24bppRGB, NULL, &bm);
|
|
|
|
expect(Ok, stat);
|
|
|
|
|
|
|
|
/* write, modify */
|
|
|
|
stat = GdipBitmapLockBits(bm, &rect, ImageLockModeWrite, PixelFormat24bppRGB, &bd);
|
|
|
|
expect(Ok, stat);
|
|
|
|
|
|
|
|
if (stat == Ok) {
|
|
|
|
if (bd.Scan0)
|
|
|
|
((char*)bd.Scan0)[2] = 0xff;
|
|
|
|
|
|
|
|
stat = GdipBitmapUnlockBits(bm, &bd);
|
|
|
|
expect(Ok, stat);
|
|
|
|
}
|
|
|
|
|
|
|
|
stat = GdipDisposeImage((GpImage*)bm);
|
|
|
|
expect(Ok, stat);
|
|
|
|
|
|
|
|
/* dispose locked */
|
|
|
|
stat = GdipCreateBitmapFromScan0(WIDTH, HEIGHT, 0, PixelFormat24bppRGB, NULL, &bm);
|
|
|
|
expect(Ok, stat);
|
|
|
|
stat = GdipBitmapLockBits(bm, &rect, ImageLockModeRead, PixelFormat24bppRGB, &bd);
|
|
|
|
expect(Ok, stat);
|
|
|
|
stat = GdipDisposeImage((GpImage*)bm);
|
|
|
|
expect(Ok, stat);
|
|
|
|
}
|
|
|
|
|
2008-03-22 00:39:22 +01:00
|
|
|
static void test_GdipCreateBitmapFromHBITMAP(void)
|
|
|
|
{
|
|
|
|
GpBitmap* gpbm = NULL;
|
|
|
|
HBITMAP hbm = NULL;
|
|
|
|
HPALETTE hpal = NULL;
|
|
|
|
GpStatus stat;
|
|
|
|
BYTE buff[1000];
|
|
|
|
LOGPALETTE* LogPal = NULL;
|
|
|
|
REAL width, height;
|
|
|
|
const REAL WIDTH1 = 5;
|
|
|
|
const REAL HEIGHT1 = 15;
|
|
|
|
const REAL WIDTH2 = 10;
|
|
|
|
const REAL HEIGHT2 = 20;
|
|
|
|
HDC hdc;
|
|
|
|
BITMAPINFO bmi;
|
|
|
|
|
|
|
|
stat = GdipCreateBitmapFromHBITMAP(NULL, NULL, NULL);
|
|
|
|
expect(InvalidParameter, stat);
|
|
|
|
|
|
|
|
hbm = CreateBitmap(WIDTH1, HEIGHT1, 1, 1, NULL);
|
|
|
|
stat = GdipCreateBitmapFromHBITMAP(hbm, NULL, NULL);
|
|
|
|
expect(InvalidParameter, stat);
|
|
|
|
|
|
|
|
stat = GdipCreateBitmapFromHBITMAP(hbm, NULL, &gpbm);
|
|
|
|
expect(Ok, stat);
|
|
|
|
expect(Ok, GdipGetImageDimension((GpImage*) gpbm, &width, &height));
|
|
|
|
ok(fabs(WIDTH1 - width) < .0001, "width wrong\n");
|
|
|
|
ok(fabs(HEIGHT1 - height) < .0001, "height wrong\n");
|
|
|
|
if (stat == Ok)
|
|
|
|
GdipDisposeImage((GpImage*)gpbm);
|
|
|
|
GlobalFree(hbm);
|
|
|
|
|
|
|
|
hbm = CreateBitmap(WIDTH2, HEIGHT2, 1, 1, &buff);
|
|
|
|
stat = GdipCreateBitmapFromHBITMAP(hbm, NULL, &gpbm);
|
|
|
|
expect(Ok, stat);
|
|
|
|
expect(Ok, GdipGetImageDimension((GpImage*) gpbm, &width, &height));
|
|
|
|
ok(fabs(WIDTH2 - width) < .0001, "width wrong\n");
|
|
|
|
ok(fabs(HEIGHT2 - height) < .0001, "height wrong\n");
|
|
|
|
if (stat == Ok)
|
|
|
|
GdipDisposeImage((GpImage*)gpbm);
|
|
|
|
GlobalFree(hbm);
|
|
|
|
|
|
|
|
hdc = CreateCompatibleDC(0);
|
|
|
|
ok(hdc != NULL, "CreateCompatibleDC failed\n");
|
|
|
|
bmi.bmiHeader.biSize = sizeof(bmi.bmiHeader);
|
|
|
|
bmi.bmiHeader.biHeight = HEIGHT1;
|
|
|
|
bmi.bmiHeader.biWidth = WIDTH1;
|
|
|
|
bmi.bmiHeader.biBitCount = 24;
|
|
|
|
bmi.bmiHeader.biPlanes = 1;
|
|
|
|
bmi.bmiHeader.biCompression = BI_RGB;
|
|
|
|
|
|
|
|
hbm = CreateDIBSection(hdc, &bmi, DIB_RGB_COLORS, NULL, NULL, 0);
|
|
|
|
ok(hbm != NULL, "CreateDIBSection failed\n");
|
|
|
|
|
|
|
|
stat = GdipCreateBitmapFromHBITMAP(hbm, NULL, &gpbm);
|
|
|
|
expect(Ok, stat);
|
|
|
|
expect(Ok, GdipGetImageDimension((GpImage*) gpbm, &width, &height));
|
|
|
|
ok(fabs(WIDTH1 - width) < .0001, "width wrong\n");
|
|
|
|
ok(fabs(HEIGHT1 - height) < .0001, "height wrong\n");
|
|
|
|
if (stat == Ok)
|
|
|
|
GdipDisposeImage((GpImage*)gpbm);
|
|
|
|
|
|
|
|
LogPal = GdipAlloc(sizeof(LOGPALETTE));
|
|
|
|
ok(LogPal != NULL, "unable to allocate LOGPALETTE\n");
|
|
|
|
LogPal->palVersion = 0x300;
|
|
|
|
hpal = CreatePalette((const LOGPALETTE*) LogPal);
|
|
|
|
ok(hpal != NULL, "CreatePalette failed\n");
|
|
|
|
GdipFree(LogPal);
|
|
|
|
|
|
|
|
stat = GdipCreateBitmapFromHBITMAP(hbm, hpal, &gpbm);
|
|
|
|
todo_wine
|
|
|
|
{
|
|
|
|
expect(Ok, stat);
|
|
|
|
}
|
|
|
|
if (stat == Ok)
|
|
|
|
GdipDisposeImage((GpImage*)gpbm);
|
|
|
|
|
|
|
|
GlobalFree(hpal);
|
|
|
|
GlobalFree(hbm);
|
|
|
|
}
|
|
|
|
|
2007-08-09 04:42:20 +02:00
|
|
|
START_TEST(image)
|
|
|
|
{
|
2007-08-11 01:22:47 +02:00
|
|
|
struct GdiplusStartupInput gdiplusStartupInput;
|
|
|
|
ULONG_PTR gdiplusToken;
|
|
|
|
|
|
|
|
gdiplusStartupInput.GdiplusVersion = 1;
|
|
|
|
gdiplusStartupInput.DebugEventCallback = NULL;
|
|
|
|
gdiplusStartupInput.SuppressBackgroundThread = 0;
|
|
|
|
gdiplusStartupInput.SuppressExternalCodecs = 0;
|
|
|
|
|
|
|
|
GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL);
|
|
|
|
|
2007-08-09 04:42:20 +02:00
|
|
|
test_Scan0();
|
2008-02-27 10:36:44 +01:00
|
|
|
test_GetImageDimension();
|
2008-02-24 16:41:28 +01:00
|
|
|
test_LoadingImages();
|
2008-03-10 16:16:54 +01:00
|
|
|
test_SavingImages();
|
2008-03-06 10:17:00 +01:00
|
|
|
test_encoders();
|
2008-03-07 10:19:02 +01:00
|
|
|
test_LockBits();
|
2008-03-22 00:39:22 +01:00
|
|
|
test_GdipCreateBitmapFromHBITMAP();
|
2007-08-11 01:22:47 +02:00
|
|
|
|
|
|
|
GdiplusShutdown(gdiplusToken);
|
2007-08-09 04:42:20 +02:00
|
|
|
}
|