# dxGetMaterialSize (Client)

> Returns the size of an image in pixels.

- **Platform**: MY Multiplayer (MYMP)
- **Kind**: Lua Function
- **Side**: Client
- **Category**: Screen drawing
- **URL**: https://wiki.mymp.gg/en/dxGetMaterialSize

## Syntax

```lua
int, int dxGetMaterialSize(texture|dui material)
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `material` | `texture\|dui` | The image: a texture, render target, screen source or dui. |

## Returns

The width and the height. An argument that is not an image raises an error.

## Example

```lua
local tex = engineCreateTexture("images/map.png")
local w, h = dxGetMaterialSize(tex)
print("map is " .. w .. "x" .. h)
```

## See also

- [dxDrawImageSection (Client)](https://wiki.mymp.gg/en/dxDrawImageSection.md): Draws part of an image on the screen for one frame.
- [engineCreateTexture (Client)](https://wiki.mymp.gg/en/engineCreateTexture.md): Creates a texture from an image file in the resource or from image bytes in memory. The texture exists on this client only.
- [dxCreateRenderTarget (Client)](https://wiki.mymp.gg/en/dxCreateRenderTarget.md): Creates a render target: an image the dx functions can draw into and that can be used like any other image.
