TX Text Control .NET for Windows Forms

Twips2Pixels Method

Method|Introduced in 15.0
Namespace
TXTextControl.DocumentServer
Package
TXTextControl.TextControl.WinForms.SDK as TXDocumentServer.dll from the private NuGet feed or Text Control Offline Packages

Description

Converts a value in twips to a value in pixels according to a specified resolution. This is a helper method that is useful when implementing pixel-based document viewers.

Syntax

public static int Twips2Pixels(int twips, float dpi);

Parameters

ParameterDescription
twips

The value in twips to be converted.

dpi

The resolution the conversion is based on.

Return Value

Returns the value converted to pixels according to the specified resolution.

Examples

The following example uses Twips2 Pixels in a focused Document Controller workflow.

var result = TXTextControl.DocumentServer.DocumentController.Twips2Pixels(10, 1.0f);
Console.WriteLine($"Twips2 Pixels result: {result}");