Export (0) Print
Expand All
Expand Minimize

Graphics.SetPageScale method

Applies to: desktop apps only

The Graphics::SetPageScale method sets the scaling factor for the page transformation of this Graphics object. The page transformation converts page coordinates to device coordinates.

Syntax

Status SetPageScale(
  [in]  REAL scale
);

Parameters

scale [in]

Type: REAL

Real number that specifies the scaling factor.

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 sets the world transformation and the page transformation of a Graphics object. The page unit and the page scale both belong to the page transformation. The code sets the page unit to millimeters and sets the page scale to 10. The call to the Graphics::DrawRectangle method draws a rectangle that has a width of 3 centimeters (UnitMillimeter along with a scaling factor of 10) and a height of 2 centimeters. The rectangle is translated 4 centimeters to the right and 1 centimeter down by the world transformation.


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

   // Set the world transformation.
   graphics.TranslateTransform(4.0f, 1.0f);

   // Set the page transformation.
   graphics.SetPageUnit(UnitMillimeter);
   graphics.SetPageScale(10.0f);

   Pen pen(Color(255, 0, 0, 0), 0.0f);
   graphics.DrawRectangle(&pen, 0, 0, 3, 2);
}

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::GetDpiX
Graphics::GetDpiY
Graphics::GetPageScale
Graphics::GetPageUnit
Graphics::SetPageUnit
Unit
Types of Coordinate Systems

 

 

Send comments about this topic to Microsoft

Build date: 3/6/2012

Community Additions

ADD
Show:
© 2014 Microsoft