TX Text Control .NET for Windows Forms

DocumentToClient Method

Method|Introduced in 25.0
Namespace
TXTextControl
Package
TXTextControl.TextControl.WinForms.SDK as TXTextControl.Windows.Forms.dll from the private NuGet feed or Text Control Offline Packages

Description

Computes coordinates in twips relative to the top-left corner of the document into client coordinates.

Syntax

DocumentToClient(Point)

Computes the specified point in twips into client coordinates.

public Point DocumentToClient(Point point);
ParameterDescription
point

Specifies a document point which client coordinates are computed.

DocumentToClient(Rectangle)

Computes the specified rectangle in twips into client coordinates.

public Rectangle DocumentToClient(Rectangle rectangle);
ParameterDescription
rectangle

Specifies a document rectangle which client coordinates are computed.

Return Value

The return value specifies the computed client point or rectangle.

Examples

The following example converts a document-coordinate point to client coordinates.

var result = textControl.DocumentToClient(new System.Drawing.Point(20, 20));
Console.WriteLine($"Document To Client result: {result}");

Further Reading