M MY Multiplayer: Wiki
Side
Kind

dxGetPixelsSize

Client

Returns the width and height of an image held in a string (plain, png, jpeg or dds).

int, int|false dxGetPixelsSize(string pixels)

Parameters

NameTypeDescription
pixelsstringThe pixels.

Returns

The width and the height, or false when the format was not recognised.

Example

local file = fileOpen("images/photo.png", true)
local pixels = fileRead(file, fileGetSize(file))
fileClose(file)
local w, h = dxGetPixelsSize(pixels)

See also