Table of Contents

Class MetaState

Namespace
iText.Kernel.Pdf.Canvas.Wmf
Assembly
itext.kernel.dll

Class to keep the state.

public class MetaState
Inheritance
MetaState
Inherited Members

Constructors

MetaState()

Creates new MetaState

public MetaState()

MetaState(MetaState)

Clones a new MetaState from the specified MetaState.

public MetaState(MetaState state)

Parameters

state MetaState

the state to clone

Fields

ALTERNATE

public const int ALTERNATE = 1

Field Value

int

MetaObjects

List of MetaObjects.

public IList<MetaObject> MetaObjects

Field Value

IList<MetaObject>

OPAQUE

public const int OPAQUE = 2

Field Value

int

TA_BASELINE

public const int TA_BASELINE = 24

Field Value

int

TA_BOTTOM

public const int TA_BOTTOM = 8

Field Value

int

TA_CENTER

public const int TA_CENTER = 6

Field Value

int

TA_LEFT

public const int TA_LEFT = 0

Field Value

int

TA_NOUPDATECP

public const int TA_NOUPDATECP = 0

Field Value

int

TA_RIGHT

public const int TA_RIGHT = 2

Field Value

int

TA_TOP

public const int TA_TOP = 0

Field Value

int

TA_UPDATECP

public const int TA_UPDATECP = 1

Field Value

int

TRANSPARENT

public const int TRANSPARENT = 1

Field Value

int

WINDING

public const int WINDING = 2

Field Value

int

backgroundMode

The current background mode.

public int backgroundMode

Field Value

int

Remarks

The current background mode. Default value is OPAQUE.

currentBackgroundColor

The current background color.

public Color currentBackgroundColor

Field Value

Color

Remarks

The current background color. Default value is DeviceRgb#WHITE.

currentBrush

Current Brush.

public MetaBrush currentBrush

Field Value

MetaBrush

currentFont

Current Font.

public MetaFont currentFont

Field Value

MetaFont

currentPen

Current Pen.

public MetaPen currentPen

Field Value

MetaPen

currentPoint

Current Point.

public Point currentPoint

Field Value

Point

currentTextColor

Current text color.

public Color currentTextColor

Field Value

Color

Remarks

Current text color. Default value is DeviceRgb#BLACK.

extentWx

Current extent for Wx.

public int extentWx

Field Value

int

extentWy

Current extent for Wy.

public int extentWy

Field Value

int

lineJoin

Curent line join.

public int lineJoin

Field Value

int

Remarks

Curent line join. Default value is 1.

offsetWx

Current offset for Wx.

public int offsetWx

Field Value

int

offsetWy

Current offset for Wy.

public int offsetWy

Field Value

int

polyFillMode

Current polygon fill mode.

public int polyFillMode

Field Value

int

Remarks

Current polygon fill mode. Default value is ALTERNATE.

savedStates

Stack of saved states.

public Stack<MetaState> savedStates

Field Value

Stack<MetaState>

scalingX

Current x value for scaling.

public float scalingX

Field Value

float

scalingY

Current y value for scaling.

public float scalingY

Field Value

float

textAlign

Current text alignment.

public int textAlign

Field Value

int

Methods

AddMetaObject(MetaObject)

Add a MetaObject to the State.

public virtual void AddMetaObject(MetaObject @object)

Parameters

object MetaObject

MetaObject to be added

Cleanup(PdfCanvas)

Restres the state of the specified PdfCanvas object for as many times as there are saved states on the stack.

public virtual void Cleanup(PdfCanvas cb)

Parameters

cb PdfCanvas

PdfCanvas object

DeleteMetaObject(int)

Deletes the MetaObject at the specified index.

public virtual void DeleteMetaObject(int index)

Parameters

index int

index of the MetaObject to delete

GetBackgroundMode()

Getter for property backgroundMode.

public virtual int GetBackgroundMode()

Returns

int

Value of property backgroundMode.

GetCurrentBackgroundColor()

Getter for property currentBackgroundColor.

public virtual Color GetCurrentBackgroundColor()

Returns

Color

Value of property currentBackgroundColor.

GetCurrentBrush()

Returns the current MetaBrush object.

public virtual MetaBrush GetCurrentBrush()

Returns

MetaBrush

current MetaBrush

GetCurrentFont()

Returns the current MetaFont object.

public virtual MetaFont GetCurrentFont()

Returns

MetaFont

current MetaFont

GetCurrentPen()

Returns the current MetaPen object.

public virtual MetaPen GetCurrentPen()

Returns

MetaPen

current MetaPen

GetCurrentPoint()

Returns the current Point.

public virtual Point GetCurrentPoint()

Returns

Point

current Point

GetCurrentTextColor()

Getter for property currentTextColor.

public virtual Color GetCurrentTextColor()

Returns

Color

Value of property currentTextColor.

GetLineNeutral()

Returns true if lineJoin is 0.

public virtual bool GetLineNeutral()

Returns

bool

true if lineJoin is 0

GetPolyFillMode()

Getter for property polyFillMode.

public virtual int GetPolyFillMode()

Returns

int

Value of property polyFillMode.

GetTextAlign()

Getter for property textAlign.

public virtual int GetTextAlign()

Returns

int

Value of property textAlign.

RestoreState(int, PdfCanvas)

Restores the state to the next state on the saved states stack.

public virtual void RestoreState(int index, PdfCanvas cb)

Parameters

index int

index of the state to be restored

cb PdfCanvas

PdfCanvas object on which restoreState() will be called

SaveState(PdfCanvas)

Saves the state of this MetaState object.

public virtual void SaveState(PdfCanvas cb)

Parameters

cb PdfCanvas

PdfCanvas object on which saveState() will be called

SelectMetaObject(int, PdfCanvas)

Select the MetaObject at the specified index and prepare the PdfCanvas.

public virtual void SelectMetaObject(int index, PdfCanvas cb)

Parameters

index int

position of the MetaObject

cb PdfCanvas

PdfCanvas to prepare

SetBackgroundMode(int)

Setter for property backgroundMode.

public virtual void SetBackgroundMode(int backgroundMode)

Parameters

backgroundMode int

New value of property backgroundMode.

SetCurrentBackgroundColor(Color)

Setter for property currentBackgroundColor.

public virtual void SetCurrentBackgroundColor(Color currentBackgroundColor)

Parameters

currentBackgroundColor Color

New value of property currentBackgroundColor.

SetCurrentPoint(Point)

Sets the current Point to the specified Point.

public virtual void SetCurrentPoint(Point p)

Parameters

p Point

Point to set

SetCurrentTextColor(Color)

Setter for property currentTextColor.

public virtual void SetCurrentTextColor(Color currentTextColor)

Parameters

currentTextColor Color

New value of property currentTextColor.

SetExtentWx(int)

Sets the Wx extent value.

public virtual void SetExtentWx(int extentWx)

Parameters

extentWx int

Wx extent value

SetExtentWy(int)

Sets the Wy extent value.

public virtual void SetExtentWy(int extentWy)

Parameters

extentWy int

Wy extent value

SetLineJoinPolygon(PdfCanvas)

Sets the line join style to ROUND if lineJoin is 0.

public virtual void SetLineJoinPolygon(PdfCanvas cb)

Parameters

cb PdfCanvas

PdfCanvas to set the line join style

SetLineJoinRectangle(PdfCanvas)

Sets the line join style to MITER if lineJoin isn't 0.

public virtual void SetLineJoinRectangle(PdfCanvas cb)

Parameters

cb PdfCanvas

PdfCanvas to set the line join style

SetMetaState(MetaState)

Sets every field of this MetaState to the values of the fields of the specified MetaState.

public virtual void SetMetaState(MetaState state)

Parameters

state MetaState

state to copy

SetOffsetWx(int)

Sets the Wx offset value.

public virtual void SetOffsetWx(int offsetWx)

Parameters

offsetWx int

Wx offset value

SetOffsetWy(int)

Sets the Wy offset value.

public virtual void SetOffsetWy(int offsetWy)

Parameters

offsetWy int

Wy offset value

SetPolyFillMode(int)

Setter for property polyFillMode.

public virtual void SetPolyFillMode(int polyFillMode)

Parameters

polyFillMode int

New value of property polyFillMode.

SetScalingX(float)

Sets the x value for scaling.

public virtual void SetScalingX(float scalingX)

Parameters

scalingX float

x value for scaling

SetScalingY(float)

Sets the y value for scaling.

public virtual void SetScalingY(float scalingY)

Parameters

scalingY float

y value for scaling

SetTextAlign(int)

Setter for property textAlign.

public virtual void SetTextAlign(int textAlign)

Parameters

textAlign int

New value of property textAlign.

TransformAngle(float)

Transforms the specified angle.

public virtual float TransformAngle(float angle)

Parameters

angle float

the angle to transform

Returns

float

the transformed angle

Remarks

Transforms the specified angle. If scalingY is less than 0, the angle is multiplied by -1. If scalingX is less than 0, the angle is subtracted from Math.PI.

TransformX(int)

Transform the specified value.

public virtual float TransformX(int x)

Parameters

x int

the value to transform

Returns

float

the transformed value

TransformY(int)

Transform the specified value.

public virtual float TransformY(int y)

Parameters

y int

the value to transform

Returns

float

transformed value