dxGetPixelsFormat
Client
Detects the format of an image held in a string.
string|false dxGetPixelsFormat(string pixels)
Parameters
| Name | Type | Description |
|---|---|---|
| pixels | string | The pixels. |
Returns
plain, png, jpeg or dds, or false when it was not recognised.
Example
local file = fileOpen("images/photo.jpg", true)
local pixels = fileRead(file, fileGetSize(file))
fileClose(file)
print(dxGetPixelsFormat(pixels))