+static void test_GdipGetVisibleClipBounds_screen(void)
+{
+ GpStatus status;
+ GpGraphics *graphics = NULL;
+ HDC hdc = GetDC(0);
+ GpRectF rectf, exp, clipr;
+ GpRect recti;
+
+ ok(hdc != NULL, "Expected HDC to be initialized\n");
+
+ status = GdipCreateFromHDC(hdc, &graphics);
+ expect(Ok, status);
+ ok(graphics != NULL, "Expected graphics to be initialized\n");
+
+ /* no clipping rect */
+ exp.X = 0;
+ exp.Y = 0;
+ exp.Width = GetDeviceCaps(hdc, HORZRES);
+ exp.Height = GetDeviceCaps(hdc, VERTRES);
+
+ status = GdipGetVisibleClipBounds(graphics, &rectf);
+ expect(Ok, status);
+ ok(rectf.X == exp.X &&
+ rectf.Y == exp.Y &&
+ rectf.Width == exp.Width &&
+ rectf.Height == exp.Height,
+ "Expected clip bounds (%0.f, %0.f, %0.f, %0.f) to be the size of "
+ "the screen (%0.f, %0.f, %0.f, %0.f)\n",
+ rectf.X, rectf.Y, rectf.Width, rectf.Height,
+ exp.X, exp.Y, exp.Width, exp.Height);
+
+ /* clipping rect entirely within window */
+ exp.X = clipr.X = 10;
+ exp.Y = clipr.Y = 12;
+ exp.Width = clipr.Width = 14;
+ exp.Height = clipr.Height = 16;
+
+ status = GdipSetClipRect(graphics, clipr.X, clipr.Y, clipr.Width, clipr.Height, CombineModeReplace);
+ expect(Ok, status);
+
+ status = GdipGetVisibleClipBounds(graphics, &rectf);
+ expect(Ok, status);
+ ok(rectf.X == exp.X &&
+ rectf.Y == exp.Y &&
+ rectf.Width == exp.Width &&
+ rectf.Height == exp.Height,
+ "Expected clip bounds (%0.f, %0.f, %0.f, %0.f) to be the size of "
+ "the clipping rect (%0.f, %0.f, %0.f, %0.f)\n",
+ rectf.X, rectf.Y, rectf.Width, rectf.Height,
+ exp.X, exp.Y, exp.Width, exp.Height);
+
+ /* clipping rect partially outside of screen */
+ clipr.X = -10;
+ clipr.Y = -12;
+ clipr.Width = 20;
+ clipr.Height = 24;
+
+ status = GdipSetClipRect(graphics, clipr.X, clipr.Y, clipr.Width, clipr.Height, CombineModeReplace);
+ expect(Ok, status);
+
+ exp.X = 0;
+ exp.Y = 0;
+ exp.Width = 10;
+ exp.Height = 12;
+
+ status = GdipGetVisibleClipBounds(graphics, &rectf);
+ expect(Ok, status);
+ ok(rectf.X == exp.X &&
+ rectf.Y == exp.Y &&
+ rectf.Width == exp.Width &&
+ rectf.Height == exp.Height,
+ "Expected clip bounds (%0.f, %0.f, %0.f, %0.f) to be the size of "
+ "the visible clipping rect (%0.f, %0.f, %0.f, %0.f)\n",
+ rectf.X, rectf.Y, rectf.Width, rectf.Height,
+ exp.X, exp.Y, exp.Width, exp.Height);
+
+ status = GdipGetVisibleClipBoundsI(graphics, &recti);
+ expect(Ok, status);
+ ok(recti.X == exp.X &&
+ recti.Y == exp.Y &&
+ recti.Width == exp.Width &&
+ recti.Height == exp.Height,
+ "Expected clip bounds (%d, %d, %d, %d) to be the size of "
+ "the visible clipping rect (%0.f, %0.f, %0.f, %0.f)\n",
+ recti.X, recti.Y, recti.Width, recti.Height,
+ exp.X, exp.Y, exp.Width, exp.Height);
+
+ GdipDeleteGraphics(graphics);
+ ReleaseDC(0, hdc);
+}
+
+static void test_GdipGetVisibleClipBounds_window(void)
+{
+ GpStatus status;
+ GpGraphics *graphics = NULL;
+ GpRectF rectf, window, exp, clipr;
+ GpRect recti;
+ HWND hwnd;
+ WNDCLASSA class;
+ HDC hdc;
+ PAINTSTRUCT ps;
+ HINSTANCE hInstance = GetModuleHandle(NULL);
+ RECT wnd_rect;
+
+ window.X = 0;
+ window.Y = 0;
+ window.Width = 200;
+ window.Height = 300;
+
+ class.lpszClassName = "ClipBoundsTestClass";
+ class.style = CS_HREDRAW | CS_VREDRAW;
+ class.lpfnWndProc = DefWindowProcA;
+ class.hInstance = hInstance;
+ class.hIcon = LoadIcon(0, IDI_APPLICATION);
+ class.hCursor = LoadCursor(NULL, IDC_ARROW);
+ class.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
+ class.lpszMenuName = 0;
+ class.cbClsExtra = 0;
+ class.cbWndExtra = 0;
+ RegisterClass(&class);
+
+ hwnd = CreateWindow(class.lpszClassName, "ClipboundsTest",
+ WS_OVERLAPPEDWINDOW, window.X, window.Y, window.Width, window.Height,
+ NULL, NULL, hInstance, NULL);
+
+ ok(hwnd != NULL, "Expected window to be created\n");
+
+ /* get client area size */
+ ok(GetClientRect(hwnd, &wnd_rect), "GetClientRect should have succeeded\n");
+ window.X = wnd_rect.left;
+ window.Y = wnd_rect.top;
+ window.Width = wnd_rect.right - wnd_rect.left;
+ window.Height = wnd_rect.bottom - wnd_rect.top;
+
+ hdc = BeginPaint(hwnd, &ps);
+
+ status = GdipCreateFromHDC(hdc, &graphics);
+ expect(Ok, status);
+ ok(graphics != NULL, "Expected graphics to be initialized\n");
+
+ status = GdipGetVisibleClipBounds(graphics, &rectf);
+ expect(Ok, status);
+ ok(rectf.X == window.X &&
+ rectf.Y == window.Y &&
+ rectf.Width == window.Width &&
+ rectf.Height == window.Height,
+ "Expected clip bounds (%0.f, %0.f, %0.f, %0.f) to be the size of "
+ "the window (%0.f, %0.f, %0.f, %0.f)\n",
+ rectf.X, rectf.Y, rectf.Width, rectf.Height,
+ window.X, window.Y, window.Width, window.Height);
+
+ /* clipping rect entirely within window */
+ exp.X = clipr.X = 20;
+ exp.Y = clipr.Y = 8;
+ exp.Width = clipr.Width = 30;
+ exp.Height = clipr.Height = 20;
+
+ status = GdipSetClipRect(graphics, clipr.X, clipr.Y, clipr.Width, clipr.Height, CombineModeReplace);
+ expect(Ok, status);
+
+ status = GdipGetVisibleClipBounds(graphics, &rectf);
+ expect(Ok, status);
+ ok(rectf.X == exp.X &&
+ rectf.Y == exp.Y &&
+ rectf.Width == exp.Width &&
+ rectf.Height == exp.Height,
+ "Expected clip bounds (%0.f, %0.f, %0.f, %0.f) to be the size of "
+ "the clipping rect (%0.f, %0.f, %0.f, %0.f)\n",
+ rectf.X, rectf.Y, rectf.Width, rectf.Height,
+ exp.X, exp.Y, exp.Width, exp.Height);
+
+ /* clipping rect partially outside of window */
+ clipr.X = window.Width - 10;
+ clipr.Y = window.Height - 15;
+ clipr.Width = 20;
+ clipr.Height = 30;
+
+ status = GdipSetClipRect(graphics, clipr.X, clipr.Y, clipr.Width, clipr.Height, CombineModeReplace);
+ expect(Ok, status);
+
+ exp.X = window.Width - 10;
+ exp.Y = window.Height - 15;
+ exp.Width = 10;
+ exp.Height = 15;
+
+ status = GdipGetVisibleClipBounds(graphics, &rectf);
+ expect(Ok, status);
+ ok(rectf.X == exp.X &&
+ rectf.Y == exp.Y &&
+ rectf.Width == exp.Width &&
+ rectf.Height == exp.Height,
+ "Expected clip bounds (%0.f, %0.f, %0.f, %0.f) to be the size of "
+ "the visible clipping rect (%0.f, %0.f, %0.f, %0.f)\n",
+ rectf.X, rectf.Y, rectf.Width, rectf.Height,
+ exp.X, exp.Y, exp.Width, exp.Height);
+
+ status = GdipGetVisibleClipBoundsI(graphics, &recti);
+ expect(Ok, status);
+ ok(recti.X == exp.X &&
+ recti.Y == exp.Y &&
+ recti.Width == exp.Width &&
+ recti.Height == exp.Height,
+ "Expected clip bounds (%d, %d, %d, %d) to be the size of "
+ "the visible clipping rect (%0.f, %0.f, %0.f, %0.f)\n",
+ recti.X, recti.Y, recti.Width, recti.Height,
+ exp.X, exp.Y, exp.Width, exp.Height);
+
+ GdipDeleteGraphics(graphics);
+ EndPaint(hwnd, &ps);
+ DestroyWindow(hwnd);
+}
+
+static void test_GdipGetVisibleClipBounds(void)
+{
+ GpGraphics* graphics = NULL;
+ GpRectF rectf;
+ GpRect rect;
+ HDC hdc = GetDC(0);
+ GpStatus status;
+
+ status = GdipCreateFromHDC(hdc, &graphics);
+ expect(Ok, status);
+ ok(graphics != NULL, "Expected graphics to be initialized\n");
+
+ /* test null parameters */
+ status = GdipGetVisibleClipBounds(graphics, NULL);
+ expect(InvalidParameter, status);
+
+ status = GdipGetVisibleClipBounds(NULL, &rectf);
+ expect(InvalidParameter, status);
+
+ status = GdipGetVisibleClipBoundsI(graphics, NULL);
+ expect(InvalidParameter, status);
+
+ status = GdipGetVisibleClipBoundsI(NULL, &rect);
+ expect(InvalidParameter, status);
+
+ GdipDeleteGraphics(graphics);
+ ReleaseDC(0, hdc);
+
+ test_GdipGetVisibleClipBounds_screen();
+ test_GdipGetVisibleClipBounds_window();
+}
+
+static void test_fromMemoryBitmap(void)
+{
+ GpStatus status;
+ GpGraphics *graphics = NULL;
+ GpBitmap *bitmap = NULL;
+ BYTE bits[48] = {0};
+
+ status = GdipCreateBitmapFromScan0(4, 4, 12, PixelFormat24bppRGB, bits, &bitmap);
+ expect(Ok, status);
+
+ status = GdipGetImageGraphicsContext((GpImage*)bitmap, &graphics);
+ expect(Ok, status);
+
+ status = GdipGraphicsClear(graphics, 0xff686868);
+ expect(Ok, status);
+
+ GdipDeleteGraphics(graphics);
+
+ /* drawing writes to the memory provided */
+ todo_wine expect(0x68, bits[10]);
+
+ GdipDisposeImage((GpImage*)bitmap);
+}
+
+static void test_GdipIsVisiblePoint(void)
+{
+ GpStatus status;
+ GpGraphics *graphics = NULL;
+ HDC hdc = GetDC(0);
+ REAL x, y;
+ BOOL val;
+
+ ok(hdc != NULL, "Expected HDC to be initialized\n");
+
+ status = GdipCreateFromHDC(hdc, &graphics);
+ expect(Ok, status);
+ ok(graphics != NULL, "Expected graphics to be initialized\n");
+
+ /* null parameters */
+ status = GdipIsVisiblePoint(NULL, 0, 0, &val);
+ expect(InvalidParameter, status);
+
+ status = GdipIsVisiblePoint(graphics, 0, 0, NULL);
+ expect(InvalidParameter, status);
+
+ status = GdipIsVisiblePointI(NULL, 0, 0, &val);
+ expect(InvalidParameter, status);
+
+ status = GdipIsVisiblePointI(graphics, 0, 0, NULL);
+ expect(InvalidParameter, status);
+
+ x = 0;
+ y = 0;
+ status = GdipIsVisiblePoint(graphics, x, y, &val);
+ expect(Ok, status);
+ ok(val == TRUE, "Expected (%.2f, %.2f) to be visible\n", x, y);
+
+ x = -10;
+ y = 0;
+ status = GdipIsVisiblePoint(graphics, x, y, &val);
+ expect(Ok, status);
+ ok(val == FALSE, "Expected (%.2f, %.2f) not to be visible\n", x, y);
+
+ x = 0;
+ y = -5;
+ status = GdipIsVisiblePoint(graphics, x, y, &val);
+ expect(Ok, status);
+ ok(val == FALSE, "Expected (%.2f, %.2f) not to be visible\n", x, y);
+
+ x = 1;
+ y = 1;
+ status = GdipIsVisiblePoint(graphics, x, y, &val);
+ expect(Ok, status);
+ ok(val == TRUE, "Expected (%.2f, %.2f) to be visible\n", x, y);
+
+ status = GdipSetClipRect(graphics, 10, 20, 30, 40, CombineModeReplace);
+ expect(Ok, status);
+
+ x = 1;
+ y = 1;
+ status = GdipIsVisiblePoint(graphics, x, y, &val);
+ expect(Ok, status);
+ ok(val == FALSE, "After clipping, expected (%.2f, %.2f) not to be visible\n", x, y);
+
+ x = 15.5;
+ y = 40.5;
+ status = GdipIsVisiblePoint(graphics, x, y, &val);
+ expect(Ok, status);
+ ok(val == TRUE, "After clipping, expected (%.2f, %.2f) to be visible\n", x, y);
+
+ /* translate into the center of the rect */
+ GdipTranslateWorldTransform(graphics, 25, 40, MatrixOrderAppend);
+
+ x = 0;
+ y = 0;
+ status = GdipIsVisiblePoint(graphics, x, y, &val);
+ expect(Ok, status);
+ ok(val == TRUE, "Expected (%.2f, %.2f) to be visible\n", x, y);
+
+ x = 25;
+ y = 40;
+ status = GdipIsVisiblePoint(graphics, x, y, &val);
+ expect(Ok, status);
+ ok(val == FALSE, "Expected (%.2f, %.2f) not to be visible\n", x, y);
+
+ GdipTranslateWorldTransform(graphics, -25, -40, MatrixOrderAppend);
+
+ /* corner cases */
+ x = 9;
+ y = 19;
+ status = GdipIsVisiblePoint(graphics, x, y, &val);
+ expect(Ok, status);
+ ok(val == FALSE, "After clipping, expected (%.2f, %.2f) not to be visible\n", x, y);
+
+ x = 9.25;
+ y = 19.25;
+ status = GdipIsVisiblePoint(graphics, x, y, &val);
+ expect(Ok, status);
+ ok(val == FALSE, "After clipping, expected (%.2f, %.2f) not to be visible\n", x, y);
+
+ x = 9.5;
+ y = 19.5;
+ status = GdipIsVisiblePoint(graphics, x, y, &val);
+ expect(Ok, status);
+ ok(val == TRUE, "After clipping, expected (%.2f, %.2f) to be visible\n", x, y);
+
+ x = 9.75;
+ y = 19.75;
+ status = GdipIsVisiblePoint(graphics, x, y, &val);
+ expect(Ok, status);
+ ok(val == TRUE, "After clipping, expected (%.2f, %.2f) to be visible\n", x, y);
+
+ x = 10;
+ y = 20;
+ status = GdipIsVisiblePoint(graphics, x, y, &val);
+ expect(Ok, status);
+ ok(val == TRUE, "After clipping, expected (%.2f, %.2f) to be visible\n", x, y);
+
+ x = 40;
+ y = 20;
+ status = GdipIsVisiblePoint(graphics, x, y, &val);
+ expect(Ok, status);
+ ok(val == FALSE, "After clipping, expected (%.2f, %.2f) not to be visible\n", x, y);
+
+ x = 39;
+ y = 59;
+ status = GdipIsVisiblePoint(graphics, x, y, &val);
+ expect(Ok, status);
+ ok(val == TRUE, "After clipping, expected (%.2f, %.2f) to be visible\n", x, y);
+
+ x = 39.25;
+ y = 59.25;
+ status = GdipIsVisiblePoint(graphics, x, y, &val);
+ expect(Ok, status);
+ ok(val == TRUE, "After clipping, expected (%.2f, %.2f) to be visible\n", x, y);
+
+ x = 39.5;
+ y = 39.5;
+ status = GdipIsVisiblePoint(graphics, x, y, &val);
+ expect(Ok, status);
+ ok(val == FALSE, "After clipping, expected (%.2f, %.2f) not to be visible\n", x, y);
+
+ x = 39.75;
+ y = 59.75;
+ status = GdipIsVisiblePoint(graphics, x, y, &val);
+ expect(Ok, status);
+ ok(val == FALSE, "After clipping, expected (%.2f, %.2f) not to be visible\n", x, y);
+
+ x = 40;
+ y = 60;
+ status = GdipIsVisiblePoint(graphics, x, y, &val);
+ expect(Ok, status);
+ ok(val == FALSE, "After clipping, expected (%.2f, %.2f) not to be visible\n", x, y);
+
+ x = 40.15;
+ y = 60.15;
+ status = GdipIsVisiblePoint(graphics, x, y, &val);
+ expect(Ok, status);
+ ok(val == FALSE, "After clipping, expected (%.2f, %.2f) not to be visible\n", x, y);
+
+ x = 10;
+ y = 60;
+ status = GdipIsVisiblePoint(graphics, x, y, &val);
+ expect(Ok, status);
+ ok(val == FALSE, "After clipping, expected (%.2f, %.2f) not to be visible\n", x, y);
+
+ /* integer version */
+ x = 25;
+ y = 30;
+ status = GdipIsVisiblePointI(graphics, (INT)x, (INT)y, &val);
+ expect(Ok, status);
+ ok(val == TRUE, "After clipping, expected (%.2f, %.2f) to be visible\n", x, y);
+
+ x = 50;
+ y = 100;
+ status = GdipIsVisiblePointI(graphics, (INT)x, (INT)y, &val);
+ expect(Ok, status);
+ ok(val == FALSE, "After clipping, expected (%.2f, %.2f) not to be visible\n", x, y);
+
+ GdipDeleteGraphics(graphics);
+ ReleaseDC(0, hdc);
+}
+
+static void test_GdipIsVisibleRect(void)
+{
+ GpStatus status;
+ GpGraphics *graphics = NULL;
+ HDC hdc = GetDC(0);
+ REAL x, y, width, height;
+ BOOL val;
+
+ ok(hdc != NULL, "Expected HDC to be initialized\n");
+
+ status = GdipCreateFromHDC(hdc, &graphics);
+ expect(Ok, status);
+ ok(graphics != NULL, "Expected graphics to be initialized\n");
+
+ status = GdipIsVisibleRect(NULL, 0, 0, 0, 0, &val);
+ expect(InvalidParameter, status);
+
+ status = GdipIsVisibleRect(graphics, 0, 0, 0, 0, NULL);
+ expect(InvalidParameter, status);
+
+ status = GdipIsVisibleRectI(NULL, 0, 0, 0, 0, &val);
+ expect(InvalidParameter, status);
+
+ status = GdipIsVisibleRectI(graphics, 0, 0, 0, 0, NULL);
+ expect(InvalidParameter, status);
+
+ /* entirely within the visible region */
+ x = 0; width = 10;
+ y = 0; height = 10;
+ status = GdipIsVisibleRect(graphics, x, y, width, height, &val);
+ expect(Ok, status);
+ ok(val == TRUE, "Expected (%.2f, %.2f, %.2f, %.2f) to be visible\n", x, y, width, height);
+
+ /* partially outside */
+ x = -10; width = 20;
+ y = -10; height = 20;
+ status = GdipIsVisibleRect(graphics, x, y, width, height, &val);
+ expect(Ok, status);
+ ok(val == TRUE, "Expected (%.2f, %.2f, %.2f, %.2f) to be visible\n", x, y, width, height);
+
+ /* entirely outside */
+ x = -10; width = 5;
+ y = -10; height = 5;
+ status = GdipIsVisibleRect(graphics, x, y, width, height, &val);
+ expect(Ok, status);
+ ok(val == FALSE, "Expected (%.2f, %.2f, %.2f, %.2f) not to be visible\n", x, y, width, height);
+
+ status = GdipSetClipRect(graphics, 10, 20, 30, 40, CombineModeReplace);
+ expect(Ok, status);
+
+ /* entirely within the visible region */
+ x = 12; width = 10;
+ y = 22; height = 10;
+ status = GdipIsVisibleRect(graphics, x, y, width, height, &val);
+ expect(Ok, status);
+ ok(val == TRUE, "Expected (%.2f, %.2f, %.2f, %.2f) to be visible\n", x, y, width, height);
+
+ /* partially outside */
+ x = 35; width = 10;
+ y = 55; height = 10;
+ status = GdipIsVisibleRect(graphics, x, y, width, height, &val);
+ expect(Ok, status);
+ ok(val == TRUE, "Expected (%.2f, %.2f, %.2f, %.2f) to be visible\n", x, y, width, height);
+
+ /* entirely outside */
+ x = 45; width = 5;
+ y = 65; height = 5;
+ status = GdipIsVisibleRect(graphics, x, y, width, height, &val);
+ expect(Ok, status);
+ ok(val == FALSE, "Expected (%.2f, %.2f, %.2f, %.2f) not to be visible\n", x, y, width, height);
+
+ /* translate into center of clipping rect */
+ GdipTranslateWorldTransform(graphics, 25, 40, MatrixOrderAppend);
+
+ x = 0; width = 10;
+ y = 0; height = 10;
+ status = GdipIsVisibleRect(graphics, x, y, width, height, &val);
+ expect(Ok, status);
+ ok(val == TRUE, "Expected (%.2f, %.2f, %.2f, %.2f) to be visible\n", x, y, width, height);
+
+ x = 25; width = 5;
+ y = 40; height = 5;
+ status = GdipIsVisibleRect(graphics, x, y, width, height, &val);
+ expect(Ok, status);
+ ok(val == FALSE, "Expected (%.2f, %.2f, %.2f, %.2f) not to be visible\n", x, y, width, height);
+
+ GdipTranslateWorldTransform(graphics, -25, -40, MatrixOrderAppend);
+
+ /* corners entirely outside, but some intersections */
+ x = 0; width = 70;
+ y = 0; height = 90;
+ status = GdipIsVisibleRect(graphics, x, y, width, height, &val);
+ expect(Ok, status);
+ ok(val == TRUE, "Expected (%.2f, %.2f, %.2f, %.2f) to be visible\n", x, y, width, height);
+
+ x = 0; width = 70;
+ y = 0; height = 30;
+ status = GdipIsVisibleRect(graphics, x, y, width, height, &val);
+ expect(Ok, status);
+ ok(val == TRUE, "Expected (%.2f, %.2f, %.2f, %.2f) to be visible\n", x, y, width, height);
+
+ x = 0; width = 30;
+ y = 0; height = 90;
+ status = GdipIsVisibleRect(graphics, x, y, width, height, &val);
+ expect(Ok, status);
+ ok(val == TRUE, "Expected (%.2f, %.2f, %.2f, %.2f) to be visible\n", x, y, width, height);
+
+ /* edge cases */
+ x = 0; width = 10;
+ y = 20; height = 40;
+ status = GdipIsVisibleRect(graphics, x, y, width, height, &val);
+ expect(Ok, status);
+ ok(val == FALSE, "Expected (%.2f, %.2f, %.2f, %.2f) not to be visible\n", x, y, width, height);
+
+ x = 10; width = 30;
+ y = 0; height = 20;
+ status = GdipIsVisibleRect(graphics, x, y, width, height, &val);
+ expect(Ok, status);
+ ok(val == FALSE, "Expected (%.2f, %.2f, %.2f, %.2f) not to be visible\n", x, y, width, height);
+
+ x = 40; width = 10;
+ y = 20; height = 40;
+ status = GdipIsVisibleRect(graphics, x, y, width, height, &val);
+ expect(Ok, status);
+ ok(val == FALSE, "Expected (%.2f, %.2f, %.2f, %.2f) not to be visible\n", x, y, width, height);
+
+ x = 10; width = 30;
+ y = 60; height = 10;
+ status = GdipIsVisibleRect(graphics, x, y, width, height, &val);
+ expect(Ok, status);
+ ok(val == FALSE, "Expected (%.2f, %.2f, %.2f, %.2f) not to be visible\n", x, y, width, height);
+
+ /* rounding tests */
+ x = 0.4; width = 10.4;
+ y = 20; height = 40;
+ status = GdipIsVisibleRect(graphics, x, y, width, height, &val);
+ expect(Ok, status);
+ ok(val == TRUE, "Expected (%.2f, %.2f, %.2f, %.2f) to be visible\n", x, y, width, height);
+
+ x = 10; width = 30;
+ y = 0.4; height = 20.4;
+ status = GdipIsVisibleRect(graphics, x, y, width, height, &val);
+ expect(Ok, status);
+ ok(val == TRUE, "Expected (%.2f, %.2f, %.2f, %.2f) to be visible\n", x, y, width, height);
+
+ /* integer version */
+ x = 0; width = 30;
+ y = 0; height = 90;
+ status = GdipIsVisibleRectI(graphics, (INT)x, (INT)y, (INT)width, (INT)height, &val);
+ expect(Ok, status);
+ ok(val == TRUE, "Expected (%.2f, %.2f, %.2f, %.2f) to be visible\n", x, y, width, height);
+
+ x = 12; width = 10;
+ y = 22; height = 10;
+ status = GdipIsVisibleRectI(graphics, (INT)x, (INT)y, (INT)width, (INT)height, &val);
+ expect(Ok, status);
+ ok(val == TRUE, "Expected (%.2f, %.2f, %.2f, %.2f) to be visible\n", x, y, width, height);
+
+ GdipDeleteGraphics(graphics);
+ ReleaseDC(0, hdc);
+}