Graphics.SetRenderingOrigin method

Applies to: desktop apps only

The Graphics::SetRenderingOrigin method sets the rendering origin of this Graphics object. The rendering origin is used to set the dither origin for 8-bits-per-pixel and 16-bits-per-pixel dithering and is also used to set the origin for hatch brushes.

Syntax

Status SetRenderingOrigin(
  [in]  INT x,
  [in]  INT y
);

Parameters

x [in]

Type: INT

Integer that specifies the x-coordinate of the rendering origin.

y [in]

Type: INT

Integer that specifies the y-coordinate of the rendering origin.

Return value

Type:

Type: Status

If the method succeeds, it returns Ok, which is an element of the Status enumeration.

If the method fails, it returns one of the other elements of the Status enumeration.

Examples

The following example uses a hatch brush to fill two rectangles. The first rectangle is filled using the default rendering origin. The second rectangle is filled after the rendering origin is set to (3, 0).


VOID Example_SetRenderingOrigin(HDC hdc)
{
   Graphics graphics(hdc);

   HatchBrush hatchBrush(
      HatchStyleDiagonalCross, 
      Color(255, 255, 0, 0),     // red
      Color(255, 0, 255, 255));  // aqua

   graphics.FillRectangle(&hatchBrush, 0, 0, 100, 50);
   graphics.SetRenderingOrigin(3, 0);
   graphics.FillRectangle(&hatchBrush, 0, 50, 100, 50);
}

Requirements

Minimum supported client

Windows XP, Windows 2000 Professional

Minimum supported server

Windows 2000 Server

Product

GDI+ 1.0

Header

Gdiplusgraphics.h (include Gdiplus.h)

Library

Gdiplus.lib

DLL

Gdiplus.dll

See also

Graphics
Graphics::GetRenderingOrigin

 

 

Send comments about this topic to Microsoft

Build date: 3/6/2012

Community Additions

ADD
Show: