# GetResolution()

> Gets the resolution of the window.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine.Windowing](/engine/6000.7/script-reference/unityengine/windowing.md)
* **Assembly:** UnityEngine.WindowingModule

```csharp
public Resolution GetResolution()
```

### Returns

| Type                                                                    | Description                                                                                                                            |
| ----------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| [Resolution](/engine/6000.7/script-reference/unityengine/resolution.md) | A [Resolution](/engine/6000.7/script-reference/unityengine/resolution.md) object that represents the current resolution of the window. |

### Remarks

If the window is running in windowed mode, this function retrieves the window’s resolution, in contrast to [Screen.currentResolution](/engine/6000.7/script-reference/unityengine/screen/currentresolution.md), which returns the resolution of the display. Note that the fetched resolution refresh rate defaults to 0 if retrieving the window's refresh rate isn't supported on the current platform.

### Examples

```csharp
using UnityEngine;
using UnityEngine.Windowing;

public class WindowResolutionExample : MonoBehaviour
{
    void Start()
    {
        var window = GameWindow.Main;
        Resolution res = window.GetResolution();
        Debug.Log($"Resolution: {res.width}x{res.height} @ {res.refreshRate}Hz");
    }
}
```
