gdiplus: Implement GdipSetImageAttributesWrapMode.
diff --git a/dlls/gdiplus/gdiplus_private.h b/dlls/gdiplus/gdiplus_private.h
index 2313cd5..eafed7c 100644
--- a/dlls/gdiplus/gdiplus_private.h
+++ b/dlls/gdiplus/gdiplus_private.h
@@ -296,6 +296,8 @@
struct GpImageAttributes{
WrapMode wrap;
+ ARGB outside_color;
+ BOOL clamp;
struct color_key colorkeys[ColorAdjustTypeCount];
struct color_matrix colormatrices[ColorAdjustTypeCount];
struct color_remap_table colorremaptables[ColorAdjustTypeCount];
diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c
index 790e0fb..879646a 100644
--- a/dlls/gdiplus/graphics.c
+++ b/dlls/gdiplus/graphics.c
@@ -2049,6 +2049,16 @@
stride = sizeof(ARGB) * (dst_area.right - dst_area.left);
+ if (imageAttributes &&
+ (imageAttributes->wrap != WrapModeClamp ||
+ imageAttributes->outside_color != 0x00000000 ||
+ imageAttributes->clamp))
+ {
+ static int fixme;
+ if (!fixme++)
+ FIXME("Image wrap mode not implemented\n");
+ }
+
for (x=dst_area.left; x<dst_area.right; x++)
{
for (y=dst_area.top; y<dst_area.bottom; y++)
@@ -2069,7 +2079,6 @@
if (src_x < src_area.left || src_x >= src_area.right ||
src_y < src_area.top || src_y >= src_area.bottom)
- /* FIXME: Use wrapmode */
*src_color = 0;
else
GdipBitmapGetPixel(bitmap, src_x, src_y, src_color);
diff --git a/dlls/gdiplus/imageattributes.c b/dlls/gdiplus/imageattributes.c
index 1a7118d..c157af3 100644
--- a/dlls/gdiplus/imageattributes.c
+++ b/dlls/gdiplus/imageattributes.c
@@ -53,6 +53,8 @@
*imageattr = GdipAlloc(sizeof(GpImageAttributes));
if(!*imageattr) return OutOfMemory;
+ (*imageattr)->wrap = WrapModeClamp;
+
TRACE("<-- %p\n", *imageattr);
return Ok;
@@ -120,17 +122,16 @@
GpStatus WINGDIPAPI GdipSetImageAttributesWrapMode(GpImageAttributes *imageAttr,
WrapMode wrap, ARGB argb, BOOL clamp)
{
- static int calls;
-
TRACE("(%p,%u,%08x,%i)\n", imageAttr, wrap, argb, clamp);
- if(!imageAttr)
+ if(!imageAttr || wrap > WrapModeClamp)
return InvalidParameter;
- if(!(calls++))
- FIXME("not implemented\n");
+ imageAttr->wrap = wrap;
+ imageAttr->outside_color = argb;
+ imageAttr->clamp = clamp;
- return NotImplemented;
+ return Ok;
}
GpStatus WINGDIPAPI GdipSetImageAttributesCachedBackground(GpImageAttributes *imageAttr,