---
name: "ctrlSetPixelPrecision"
type: command
status: ok
groups: ["GUI Control - Positioning"]
arma3_since: "1.82"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/ctrlSetPixelPrecision
revid: 309215
updated: 2022-05-03T22:40:41Z
---

# ctrlSetPixelPrecision

*Command · GUI Control - Positioning · Arma 3 v1.82*

## Description

Switches mode of pixel precision (rounding) in a given control interface.

## Syntax

```sqf
control ctrlSetPixelPrecision mode
```

**Parameters:**

- `control`: [Control](../topics/Control.md)
- `mode`: [Number](../topics/Number.md) or [String](../topics/String.md) - can be one of the following:
  - 0 / "AUTO" - control position (x, y, w, h) is always rounded to whole pixels (game default)
  - 1 / "ON" - control position (x, y, w, h) is rounded to whole pixels only when not animating
  - 2 / "OFF" - control position (x, y, w, h) is always precise, no pixel rounding applies here

**Returns:** [Nothing](../topics/Nothing.md)

## Examples

### Example 1

```sqf
_control ctrlSetPixelPrecision 2; // Enables pixel precision of the given control
```

## See also

[ctrlCommit](../commands/ctrlCommit.md) · [ctrlCreate](../commands/ctrlCreate.md) · [ctrlDelete](../commands/ctrlDelete.md) · [ctrlModel](../commands/ctrlModel.md) · [ctrlSetModel](../commands/ctrlSetModel.md) · [ctrlPosition](../commands/ctrlPosition.md) · [ctrlClassName](../commands/ctrlClassName.md) · [displayCtrl](../commands/displayCtrl.md) · [ctrlModelScale](../commands/ctrlModelScale.md) · [ctrlSetModelScale](../commands/ctrlSetModelScale.md) · [ctrlModelDirAndUp](../commands/ctrlModelDirAndUp.md) · [ctrlSetModelDirAndUp](../commands/ctrlSetModelDirAndUp.md) · [ctrlSetPosition](../commands/ctrlSetPosition.md)

<sub>Source: [BI Community Wiki — ctrlSetPixelPrecision](https://community.bistudio.com/wiki/ctrlSetPixelPrecision) (revision 309215).</sub>
