Exemplo n.º 1
0
// coverity[+alloc : arg-*3]
GpStatus WINGDIPAPI
GdipCreatePen1 (ARGB argb, REAL width, GpUnit unit, GpPen **pen)
{
	GpStatus status;
	GpPen *result;

	if (!gdiplusInitialized)
		return GdiplusNotInitialized;

	if (!pen || unit > UnitCairoPoint || unit == UnitDisplay)
		return InvalidParameter;

	result = gdip_pen_new ();
	if (!result) {
		*pen = NULL;
		return OutOfMemory;
	}

	result->color = argb;
	result->width = width;
	result->unit = unit;
	result->own_brush = TRUE;

	status = GdipCreateSolidFill (argb, (GpSolidFill **) &result->brush);
	if (status != Ok) {
		GdipDeletePen (result);
		*pen = NULL;
		return status;
	}

	*pen = result;
	return Ok;
}
Exemplo n.º 2
0
GpStatus WINGDIPAPI
GdipSetPenColor (GpPen *pen, ARGB argb)
{
	GpStatus status;
	GpSolidFill *brush;
	GpBrushType type;

	if (!pen)
		return InvalidParameter;

	GdipGetBrushType (pen->brush, &type);
	if (type == BrushTypeSolidColor) {
		ARGB brushColor;
		GdipGetSolidFillColor ((GpSolidFill *) pen->brush, &brushColor);

		// Nothing to do.
		if (brushColor == argb)
			return Ok;
	}

	// Override the brush and set it to a solid fill.
	status = GdipCreateSolidFill (argb, &brush);
	if (status != Ok)
		return status;

	pen->color = argb;
	pen->brush = (GpBrush *) brush;
	pen->changed = TRUE;

	return Ok;
}
Exemplo n.º 3
0
static
GF_Err gdip_set_brush_color(GF_STENCIL _this, GF_Color c)
{
	GPSTEN();
	CHECK_RET(GF_STENCIL_SOLID);
	if (!_sten->pSolid) 
		GdipCreateSolidFill(c, &_sten->pSolid);
	else
		GdipSetSolidFillColor(_sten->pSolid, c);

	return GF_OK;
}
Exemplo n.º 4
0
Arquivo: pen.c Projeto: GYGit/reactos
GpStatus WINGDIPAPI GdipCreatePen1(ARGB color, REAL width, GpUnit unit,
    GpPen **pen)
{
    GpBrush *brush;
    GpStatus status;

    TRACE("(%x, %.2f, %d, %p)\n", color, width, unit, pen);

    GdipCreateSolidFill(color, (GpSolidFill **)(&brush));
    status = GdipCreatePen2(brush, width, unit, pen);
    GdipDeleteBrush(brush);
    return status;
}
Exemplo n.º 5
0
static void test_type(void)
{
    GpStatus status;
    GpBrushType bt;
    GpSolidFill *brush = NULL;

    GdipCreateSolidFill((ARGB)0xdeadbeef, &brush);

    status = GdipGetBrushType((GpBrush*)brush, &bt);
    expect(Ok, status);
    expect(BrushTypeSolidColor, bt);

    GdipDeleteBrush((GpBrush*) brush);
}
Exemplo n.º 6
0
static void test_penfilltype(void)
{
    GpPen *pen;
    GpSolidFill *solid;
    GpLineGradient *line;
    GpPointF a, b;
    GpStatus status;
    GpPenType type;

    /* NULL */
    status = GdipGetPenFillType(NULL, NULL);
    expect(InvalidParameter, status);

    status = GdipCreatePen1((ARGB)0xffff00ff, 10.0f, UnitPixel, &pen);
    expect(Ok, status);
    status = GdipGetPenFillType(pen, NULL);
    expect(InvalidParameter, status);

    /* created with GdipCreatePen1() */
    status = GdipGetPenFillType(pen, &type);
    expect(Ok, status);
    expect(PenTypeSolidColor, type);
    GdipDeletePen(pen);

    /* based on SolidBrush */
    status = GdipCreateSolidFill((ARGB)0xffff00ff, &solid);
    expect(Ok, status);
    status = GdipCreatePen2((GpBrush*)solid, 10.0f, UnitPixel, &pen);
    expect(Ok, status);
    status = GdipGetPenFillType(pen, &type);
    expect(Ok, status);
    expect(PenTypeSolidColor, type);
    GdipDeletePen(pen);
    GdipDeleteBrush((GpBrush*)solid);

    /* based on LinearGradientBrush */
    a.X = a.Y = 0.0;
    b.X = b.Y = 10.0;
    status = GdipCreateLineBrush(&a, &b, (ARGB)0xffff00ff, (ARGB)0xffff0000,
                                 WrapModeTile, &line);
    expect(Ok, status);
    status = GdipCreatePen2((GpBrush*)line, 10.0f, UnitPixel, &pen);
    expect(Ok, status);
    status = GdipGetPenFillType(pen, &type);
    expect(Ok, status);
    expect(PenTypeLinearGradient, type);
    GdipDeletePen(pen);
    GdipDeleteBrush((GpBrush*)line);
}
Exemplo n.º 7
0
static void test_constructor_destructor(void)
{
    GpStatus status;
    GpSolidFill *brush = NULL;

    status = GdipCreateSolidFill((ARGB)0xdeadbeef, &brush);
    expect(Ok, status);
    ok(brush != NULL, "Expected brush to be initialized\n");

    status = GdipDeleteBrush(NULL);
    expect(InvalidParameter, status);

    status = GdipDeleteBrush((GpBrush*) brush);
    expect(Ok, status);
}
Exemplo n.º 8
0
static void test_brushfill(void)
{
    GpStatus status;
    GpPen *pen;
    GpBrush *brush, *brush2;
    GpBrushType type;
    ARGB color = 0;

    /* default solid */
    GdipCreatePen1(0xdeadbeef, 4.5, UnitWorld, &pen);
    status = GdipGetPenBrushFill(pen, &brush);
    expect(Ok, status);
    GdipGetBrushType(brush, &type);
    expect(BrushTypeSolidColor, type);
    GdipGetPenColor(pen, &color);
    expect(0xdeadbeef, color);
    GdipDeleteBrush(brush);

    /* color controlled by brush */
    GdipCreateSolidFill(0xabaddeed, (GpSolidFill**)&brush);
    status = GdipSetPenBrushFill(pen, brush);
    expect(Ok, status);
    GdipGetPenColor(pen, &color);
    expect(0xabaddeed, color);
    GdipDeleteBrush(brush);
    color = 0;

    /* get returns a clone, not a reference */
    GdipGetPenBrushFill(pen, &brush);
    GdipSetSolidFillColor((GpSolidFill*)brush, 0xbeadfeed);
    GdipGetPenBrushFill(pen, &brush2);
    ok(brush != brush2, "Expected to get a clone, not a copy of the reference\n");
    GdipGetSolidFillColor((GpSolidFill*)brush2, &color);
    expect(0xabaddeed, color);
    GdipDeleteBrush(brush);
    GdipDeleteBrush(brush2);

    /* brush cannot be NULL */
    status = GdipSetPenBrushFill(pen, NULL);
    expect(InvalidParameter, status);

    GdipDeletePen(pen);
}
Exemplo n.º 9
0
/*GDIplus is completely bugged here, we MUST build the gradient in local coord system and apply translation
after, otherwise performances are just horrible*/
void gdip_recompute_radial_gradient(GF_STENCIL _this)
{
	s32 repeat, k;
	u32 i;
	GpPointF pt;
	GpMatrix *mat;
	GPSTEN();


	if (!_sten->needs_rebuild) return;
	_sten->needs_rebuild = GF_FALSE;


	if (_sten->pRadial) {
		GdipDeleteBrush(_sten->pRadial);
		_sten->pRadial = NULL;
	}
	if (_sten->pSolid) {
		GdipDeleteBrush(_sten->pSolid);
		_sten->pSolid = NULL;
	}
	if (_sten->circle) {
		GdipDeletePath(_sten->circle);
		_sten->circle = NULL;
	}

	GdipCreatePath(FillModeAlternate, &_sten->circle);
	/*get number of repeats*/
	if (_sten->spread == GF_GRADIENT_MODE_PAD) {


		GdipAddPathEllipse(_sten->circle, - _sten->radius.X, -_sten->radius.Y, 
								2*_sten->radius.X, 2*_sten->radius.Y);
	
		GdipCreatePathGradientFromPath(_sten->circle, &_sten->pRadial);

		ARGB *blends = new ARGB[_sten->num_pos + 1];

		/*radial blend pos are from bounds to center in gdiplus*/
		blends[0] = _sten->cols[_sten->num_pos - 1];
		for (i=0; i<_sten->num_pos;i++) {
			blends[i+1] = _sten->cols[_sten->num_pos - i - 1];
		}
	
		REAL *pos = new REAL[_sten->num_pos + 1];
		pos[0] = 0;
		for (i=0; i<_sten->num_pos;i++) {
			pos[i+1] = _sten->pos[i];
		}

		GdipSetPathGradientPresetBlend(_sten->pRadial, blends, pos, _sten->num_pos + 1);
		delete [] blends;
		delete [] pos;

		/*set focal*/
		pt = _sten->focal;
		pt.X -= _sten->center.X;
		pt.Y -= _sten->center.Y;
		GdipSetPathGradientCenterPoint(_sten->pRadial, &pt);	

		/*set transform*/
		GdipCreateMatrix(&mat);
		GdipTranslateMatrix(mat, _sten->center.X, _sten->center.Y, MatrixOrderAppend);
		if (_sten->pMat) GdipMultiplyMatrix(mat, _sten->pMat, MatrixOrderAppend);
		GdipSetTextureTransform((GpTexture*)_sten->pRadial, mat);
		GdipDeleteMatrix(mat);

		/*create back brush*/
		GdipCreateSolidFill(_sten->cols[_sten->num_pos - 1], &_sten->pSolid);
		GdipResetPath(_sten->circle);
		GdipAddPathEllipse(_sten->circle, - _sten->radius.X + _sten->center.X, -_sten->radius.Y + _sten->center.Y, 
								2*_sten->radius.X, 2*_sten->radius.Y);

	} else {
		repeat = 10;

		GdipAddPathEllipse(_sten->circle, - repeat * _sten->radius.X, - repeat*_sten->radius.Y, 
								2*repeat*_sten->radius.X,  2*repeat*_sten->radius.Y);

		GdipCreatePathGradientFromPath(_sten->circle, &_sten->pRadial);
		GdipDeletePath(_sten->circle);
		_sten->circle = NULL;

		ARGB *blends = new ARGB[_sten->num_pos*repeat];
		REAL *pos = new REAL[_sten->num_pos*repeat];

		if (_sten->spread == GF_GRADIENT_MODE_REPEAT) {
			for (k=0; k<repeat; k++) {
				for (i=0; i<_sten->num_pos; i++) {
					blends[k*_sten->num_pos + i] = _sten->cols[_sten->num_pos - i - 1];
					pos[k*_sten->num_pos + i] = (k + _sten->pos[i]) / repeat;
				}
			}
		} else {
			for (k=0; k<repeat; k++) {
				for (i=0; i<_sten->num_pos; i++) {
					u32 index = (k%2) ? (_sten->num_pos-i-1) : i;
					blends[k*_sten->num_pos + i] = _sten->cols[index];
					if (k%2) {
						pos[k*_sten->num_pos + i] = (k + (1 - _sten->pos[index]) ) / repeat;
					} else {
						pos[k*_sten->num_pos + i] = ( k + _sten->pos[i] ) / repeat;
					}
				}
			}
		}
		GdipSetPathGradientPresetBlend(_sten->pRadial, blends, pos, _sten->num_pos*repeat);
		delete [] pos;
		delete [] blends;


		/*set focal*/
		pt = _sten->focal;
		pt.X -= (1 - repeat) * (_sten->focal.X - _sten->center.X) + _sten->center.X;
		pt.Y -= (1 - repeat) * (_sten->focal.Y - _sten->center.Y) + _sten->center.Y;
		GdipSetPathGradientCenterPoint(_sten->pRadial, &pt);	

		/*set transform*/
		GdipCreateMatrix(&mat);
		GdipTranslateMatrix(mat, (1 - repeat) * (_sten->focal.X - _sten->center.X) + _sten->center.X,
								(1 - repeat) * (_sten->focal.Y - _sten->center.Y) + _sten->center.Y, 
								MatrixOrderAppend);
		if (_sten->pMat) GdipMultiplyMatrix(mat, _sten->pMat, MatrixOrderAppend);
		GdipSetTextureTransform((GpTexture*)_sten->pRadial, mat);
		GdipDeleteMatrix(mat);

		GdipSetPathGradientWrapMode(_sten->pRadial, WrapModeTileFlipXY);
	}
}
Exemplo n.º 10
0
RT_B RT_API RtGdipStretchBitmap(RT_H hBitmap, RT_H hDc, RT_N nWidth, RT_N nHeight, RT_GDIP_INTERPOLATION_MODE nInterpolationMode)
{
  GpGraphics* lpGraphics;
  GpBitmap* lpBitmap;
  GpBrush* lpBrush;
  GpStatus nStatus;
  RT_B bResult;

  lpGraphics = RT_NULL;
  lpBitmap = RT_NULL;
  lpBrush = RT_NULL;

  /* Create destination graphics hDc. */
  nStatus = GdipCreateFromHDC(hDc, &lpGraphics);
  if (nStatus)
  {
    RtGdipSetLastErrorFromGpStatus(nStatus);
    goto handle_error;
  }

  /* Adjust quality. */
  nStatus = GdipSetInterpolationMode(lpGraphics, (InterpolationMode)nInterpolationMode);
  if (nStatus)
  {
    RtGdipSetLastErrorFromGpStatus(nStatus);
    goto handle_error;
  }

  /* Create a brush to fill the background. */
  nStatus = GdipCreateSolidFill(0xFFFFFFFF, &lpBrush);
  if (nStatus)
  {
    RtGdipSetLastErrorFromGpStatus(nStatus);
    goto handle_error;
  }

  /* Fill the destination DC with a background. Necessary to avoid edges artifacts. */
  nStatus = GdipFillRectangleI(lpGraphics, lpBrush, 0, 0, nWidth, nHeight);
  if (nStatus)
  {
    RtGdipSetLastErrorFromGpStatus(nStatus);
    goto handle_error;
  }

  /* Create source image/bitmap from hBitmap. */
  nStatus = GdipCreateBitmapFromHBITMAP(hBitmap, RT_NULL, &lpBitmap);
  if (nStatus)
  {
    RtGdipSetLastErrorFromGpStatus(nStatus);
    goto handle_error;
  }

  /* Stretch. */
  nStatus = GdipDrawImageRectI(lpGraphics, lpBitmap, 0, 0, nWidth, nHeight);
  if (nStatus)
  {
    RtGdipSetLastErrorFromGpStatus(nStatus);
    goto handle_error;
  }

  bResult = RT_TRUE;
  goto free_resources;
handle_error:
  bResult = RT_FALSE;
free_resources:
  if (lpGraphics)
  {
    nStatus = GdipDeleteGraphics(lpGraphics);
    lpGraphics = RT_NULL;
    if (nStatus && bResult)
    {
      RtGdipSetLastErrorFromGpStatus(nStatus);
      goto handle_error;
    }
  }
  if (lpBitmap)
  {
    nStatus = GdipDisposeImage(lpBitmap);
    lpBitmap = RT_NULL;
    if (nStatus && bResult)
    {
      RtGdipSetLastErrorFromGpStatus(nStatus);
      goto handle_error;
    }
  }
  if (lpBrush)
  {
    nStatus = GdipDeleteBrush(lpBrush);
    lpBrush = RT_NULL;
    if (nStatus && bResult)
    {
      RtGdipSetLastErrorFromGpStatus(nStatus);
      goto handle_error;
    }
  }
  return bResult;
}
Exemplo n.º 11
0
// coverity[+alloc : arg-*1]
GpStatus WINGDIPAPI
GdipClonePen (GpPen *pen, GpPen **clonepen)
{
	GpPen *result;

	if (!pen || !clonepen)
		return InvalidParameter;

	result = gdip_pen_new ();
	if (!result) {
		*clonepen = NULL;
		return OutOfMemory;
	}

	result->own_brush = pen->own_brush;
	result->color = pen->color;
	result->width = pen->width;
	result->miter_limit = pen->miter_limit;
	result->line_join = pen->line_join;
	result->dash_style = pen->dash_style;
	result->line_cap = pen->line_cap;
	result->end_cap = pen->end_cap;
	result->mode = pen->mode;
	result->dash_offset = pen->dash_offset;
	result->dash_count = pen->dash_count;
	result->own_dash_array = pen->own_dash_array;
	result->compound_count = pen->compound_count;
	result->unit = pen->unit;
	gdip_cairo_matrix_copy (&result->matrix, &pen->matrix);
	result->changed = pen->changed;

	/* Make a copy of dash array only if it is owned by the pen - i.e. it is not
	 * a global array. */
	if (pen->dash_count > 0 && pen->own_dash_array) {
		result->dash_array = (float *) GdipAlloc (pen->dash_count * sizeof (float));
		if (!result->dash_array)
			goto error;

		memcpy (result->dash_array, pen->dash_array, pen->dash_count * sizeof (float));
	}
	else
		result->dash_array = pen->dash_array;

	if (pen->compound_count > 0) {
		result->compound_array = (float *) GdipAlloc (pen->compound_count * sizeof (float));
		if (!result->compound_array)
			goto error;

		memcpy (result->compound_array, pen->compound_array, pen->compound_count * sizeof (float));
	}

	if (pen->custom_start_cap) {
		GpStatus status = GdipCloneCustomLineCap (pen->custom_start_cap, &result->custom_start_cap);
		if (status != Ok)
			goto error;
	}

	if (pen->custom_end_cap) {
		GpStatus status = GdipCloneCustomLineCap (pen->custom_end_cap, &result->custom_end_cap);
		if (status != Ok)
			goto error;
	}

	if (pen->own_brush) {
		GpSolidFill *oldBrush = (GpSolidFill *) pen->brush;
		GpStatus status = GdipCreateSolidFill (oldBrush->color, (GpSolidFill **) &result->brush);
		if (status != Ok)
			goto error;
	} else {
		result->brush = pen->brush;
	}

	*clonepen = result;
	return Ok;

error:
	GdipDeletePen (result);
	*clonepen = NULL;
	return OutOfMemory;
}
Exemplo n.º 12
0
static void
win_draw(win_t *win)
{
	GpGraphics *gp;
	GpStatus st;
	GpImage *img;
	gunichar2 *unis;

	XClearWindow(win->dpy, win->win);

	GdipCreateFromXDrawable_linux (win->win, win->dpy, &gp);
        {	
		GpPen *pen;
		GpSolidFill *brush;
		int a = 255;
		int r = 255;
		int g = 0;
		int b = 0;
		
		GdipCreatePen1 (a << 24 | r << 16 | g << 8 | b,
				10, UnitPixel, &pen);
		
		GdipDrawRectangle (gp, pen, 10, 10, 60, 60);
		GdipDrawLine (gp, pen, 0, 0, 100, 100);
		
		GdipCreateSolidFill (a << 24 | r << 16 | g << 8 | b, &brush);
		
		printf ("%d\n",GdipFillEllipse (gp, (GpBrush*)brush, 40, 40, 50, 75));
//		return;
	}

	
	
	
	unis = g_utf8_to_utf16 ("test.jpg", -1, NULL, NULL, NULL);
	st = GdipLoadImageFromFile (unis, &img);
	CHECK_GDIP_ST(st);
	st = GdipDrawImage (gp, img, 0, 0);
	CHECK_GDIP_ST(st);
	g_free (unis);
	GdipDisposeImage (img);
	img = NULL;

	printf("jpg drawn \n");

	unis = g_utf8_to_utf16 ("test.tif", -1, NULL, NULL, NULL);
	st = GdipLoadImageFromFile (unis, &img);
	CHECK_GDIP_ST(st);
	st = GdipDrawImage (gp, img, 100, 0);
	CHECK_GDIP_ST(st);
	g_free (unis);
	GdipDisposeImage (img);
	img = NULL;

	printf("tif drawn \n");

	unis = g_utf8_to_utf16 ("test.gif", -1, NULL, NULL, NULL);
	st = GdipLoadImageFromFile (unis, &img);
	CHECK_GDIP_ST(st);
	st = GdipDrawImage (gp, img, 200, 0);
	CHECK_GDIP_ST(st);
	g_free (unis);
	GdipDisposeImage (img);
	img = NULL;

	printf("gif drawn \n");

	unis = g_utf8_to_utf16 ("test.png", -1, NULL, NULL, NULL);
	st = GdipLoadImageFromFile (unis, &img);
	CHECK_GDIP_ST(st);
	st = GdipDrawImage (gp, img, 0, 100);
	CHECK_GDIP_ST(st);
	g_free (unis);
	GdipDisposeImage (img);
	img = NULL;

	printf("png drawn \n");

	unis = g_utf8_to_utf16 ("test.bmp", -1, NULL, NULL, NULL);
	st = GdipLoadImageFromFile (unis, &img);
	CHECK_GDIP_ST(st);
	st = GdipDrawImage (gp, img, 200, 100);
	CHECK_GDIP_ST(st);
	g_free (unis);
	GdipDisposeImage (img);
	img = NULL;

	printf("bmp drawn \n");

}
GpStatus WINGDIPAPI GdipPlayMetafileRecord(GDIPCONST GpMetafile *metafile,
    EmfPlusRecordType recordType, UINT flags, UINT dataSize, GDIPCONST BYTE *data)
{
    GpStatus stat;
    GpMetafile *real_metafile = (GpMetafile*)metafile;

    TRACE("(%p,%x,%x,%d,%p)\n", metafile, recordType, flags, dataSize, data);

    if (!metafile || (dataSize && !data) || !metafile->playback_graphics)
        return InvalidParameter;

    if (recordType >= 1 && recordType <= 0x7a)
    {
        /* regular EMF record */
        if (metafile->playback_dc)
        {
            ENHMETARECORD *record;

            record = heap_alloc_zero(dataSize + 8);

            if (record)
            {
                record->iType = recordType;
                record->nSize = dataSize + 8;
                memcpy(record->dParm, data, dataSize);

                PlayEnhMetaFileRecord(metafile->playback_dc, metafile->handle_table,
                    record, metafile->handle_count);

                heap_free(record);
            }
            else
                return OutOfMemory;
        }
    }
    else
    {
        EmfPlusRecordHeader *header = (EmfPlusRecordHeader*)(data)-1;

        METAFILE_PlaybackReleaseDC((GpMetafile*)metafile);

        switch(recordType)
        {
        case EmfPlusRecordTypeHeader:
        case EmfPlusRecordTypeEndOfFile:
            break;
        case EmfPlusRecordTypeGetDC:
            METAFILE_PlaybackGetDC((GpMetafile*)metafile);
            break;
        case EmfPlusRecordTypeClear:
        {
            EmfPlusClear *record = (EmfPlusClear*)header;

            return GdipGraphicsClear(metafile->playback_graphics, record->Color);
        }
        case EmfPlusRecordTypeFillRects:
        {
            EmfPlusFillRects *record = (EmfPlusFillRects*)header;
            GpBrush *brush, *temp_brush=NULL;
            GpRectF *rects, *temp_rects=NULL;

            if (dataSize + sizeof(EmfPlusRecordHeader) < sizeof(EmfPlusFillRects))
                return InvalidParameter;

            if (flags & 0x4000)
            {
                if (dataSize + sizeof(EmfPlusRecordHeader) < sizeof(EmfPlusFillRects) + sizeof(EmfPlusRect) * record->Count)
                    return InvalidParameter;
            }
            else
            {
                if (dataSize + sizeof(EmfPlusRecordHeader) < sizeof(EmfPlusFillRects) + sizeof(GpRectF) * record->Count)
                    return InvalidParameter;
            }

            if (flags & 0x8000)
            {
                stat = GdipCreateSolidFill((ARGB)record->BrushID, (GpSolidFill**)&temp_brush);
                brush = temp_brush;
            }
            else
            {
                FIXME("brush deserialization not implemented\n");
                return NotImplemented;
            }

            if (stat == Ok)
            {
                if (flags & 0x4000)
                {
                    EmfPlusRect *int_rects = (EmfPlusRect*)(record+1);
                    int i;

                    rects = temp_rects = heap_alloc_zero(sizeof(GpRectF) * record->Count);
                    if (rects)
                    {
                        for (i=0; i<record->Count; i++)
                        {
                            rects[i].X = int_rects[i].X;
                            rects[i].Y = int_rects[i].Y;
                            rects[i].Width = int_rects[i].Width;
                            rects[i].Height = int_rects[i].Height;
                        }
                    }
                    else
                        stat = OutOfMemory;
                }
                else
                    rects = (GpRectF*)(record+1);
            }

            if (stat == Ok)
            {
                stat = GdipFillRectangles(metafile->playback_graphics, brush, rects, record->Count);
            }

            GdipDeleteBrush(temp_brush);
            heap_free(temp_rects);

            return stat;
        }
        case EmfPlusRecordTypeSetPageTransform:
        {
            EmfPlusSetPageTransform *record = (EmfPlusSetPageTransform*)header;
            GpUnit unit = (GpUnit)flags;

            if (dataSize + sizeof(EmfPlusRecordHeader) < sizeof(EmfPlusSetPageTransform))
                return InvalidParameter;

            real_metafile->page_unit = unit;
            real_metafile->page_scale = record->PageScale;

            return METAFILE_PlaybackUpdateWorldTransform(real_metafile);
        }
        default:
            FIXME("Not implemented for record type %x\n", recordType);
            return NotImplemented;
        }
    }

    return Ok;
}