From: Bartosz Kosiorek gang65@poczta.onet.pl
--- dlls/gdiplus/tests/graphics.c | 63 +++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+)
diff --git a/dlls/gdiplus/tests/graphics.c b/dlls/gdiplus/tests/graphics.c index d71bc78c2ae..6d7f0ec1ea8 100644 --- a/dlls/gdiplus/tests/graphics.c +++ b/dlls/gdiplus/tests/graphics.c @@ -1307,6 +1307,68 @@ static void test_GdipDrawLineI(void) ReleaseDC(hwnd, hdc); }
+static void test_GdipDrawImageFX(void) +{ + GpStatus status; + GpRectF source; + GpMatrix *transform; + GpGraphics *graphics = NULL; + GpBitmap *bm = NULL; + BYTE buff[400]; + BITMAPINFOHEADER bmihdr; + HDC hdc = GetDC( hwnd ); + if (!hdc) + return; + + memset(&bmihdr, 0, sizeof(bmihdr)); + bmihdr.biSize = sizeof(BITMAPINFOHEADER); + bmihdr.biWidth = 10; + bmihdr.biHeight = 10; + bmihdr.biPlanes = 1; + bmihdr.biBitCount = 32; + bmihdr.biCompression = BI_RGB; + status = GdipCreateBitmapFromGdiDib((BITMAPINFO*)&bmihdr, buff, &bm); + expect(Ok, status); + ok(NULL != bm, "Expected bitmap to be initialized\n"); + status = GdipCreateFromHDC(hdc, &graphics); + expect(Ok, status); + + status = GdipCreateMatrix2(2.0, 0.0, 0.0, 1.0, 10.0, 20.0, &transform); + expect(Ok, status); + + /* DrawImageFX with source rectangle */ + status = GdipDrawImageFX(graphics, NULL, &source, NULL, NULL, NULL, UnitPixel); + todo_wine + expect(InvalidParameter, status); + + /* DrawImageFX with source bitmap */ + status = GdipDrawImageFX(graphics, (GpImage*)bm, NULL, NULL, NULL, NULL, UnitPixel); + todo_wine + expect(Ok, status); + + /* DrawImageFX with source bitmap and transform */ + status = GdipDrawImageFX(graphics, (GpImage*)bm, NULL, transform, NULL, NULL, UnitPixel); + todo_wine + expect(Ok, status); + + /* DrawImageFX with source bitmap and source rectangle */ + source.X = source.Y = 0.0; + source.Height = source.Width = 10.0; + + status = GdipDrawImageFX(graphics, (GpImage*)bm, &source, NULL, NULL, NULL, UnitPixel); + todo_wine + expect(Ok, status); + + /* DrawImageFX with source bitmap, source rectangle, and transform */ + status = GdipDrawImageFX(graphics, (GpImage*)bm, &source, transform, NULL, NULL, UnitPixel); + todo_wine + expect(Ok, status); + + GdipDisposeImage((GpImage*)bm); + GdipDeleteGraphics(graphics); + ReleaseDC(hwnd, hdc); +} + static void test_GdipDrawImagePointsRect(void) { GpStatus status; @@ -7395,6 +7457,7 @@ START_TEST(graphics) test_GdipDrawCurve3I(); test_GdipDrawLineI(); test_GdipDrawLinesI(); + test_GdipDrawImageFX(); test_GdipDrawImagePointsRect(); test_GdipFillClosedCurve(); test_GdipFillClosedCurveI();