# DocumentController.Twips2Pixels Method

> 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.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 15.0
- **Namespace:** `TXTextControl.DocumentServer`
- **Package:** `TXTextControl.TextControl.ASP.SDK` (assembly `TXDocumentServer.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXDocumentServer.dll` from the setup
- **Path:** TX Text Control .NET Server > Reference > TXTextControl.DocumentServer > DocumentController.Twips2Pixels Method
- **499 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-documentserver/documentcontroller/twips2pixels-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-documentserver/documentcontroller/twips2pixels-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-documentserver/documentcontroller/twips2pixels-method/llms-full.txt

---

### 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

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

```vbnet
Public Shared Function Twips2Pixels(twips As Integer, dpi As Single) As Integer
```

### Parameters

| Parameter | Description |
|---|---|
| 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.

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

```vbnet
Dim result = TXTextControl.DocumentServer.DocumentController.Twips2Pixels(10, 1.0)
Console.WriteLine($"Twips2 Pixels result: {result}")
```

---

## Nearby

- **Previous:** [DocumentController.TextComponent Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-documentserver/documentcontroller/textcomponent-property/llms-full.txt)
- **Next:** [FileFormat Enumeration](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-documentserver/fileformat/enumeration/llms-full.txt)
