dxGetPixelsFormat | Multi Theft Auto: Wiki Skip to content

dxGetPixelsFormat

Client-side
Server-side
Shared

Manual Review Required

Please finish this page using the corresponding Old Wiki article. Go to Contribution guidelines for more information.


This function returns the format of pixels contained in a string.

Syntax

string dxGetPixelsFormat ( string pixels )
Required Arguments
  • pixels: MISSING_PARAM_DESC

Returns

  • string: value

Returns the format of the pixels if successful (' plain' or ' png' or ' jpeg' or ' dds' ), false if invalid arguments were passed to the function.

Code Examples

shared

The example loads an image, gets its pixels, and outputs the pixels format. (You can usethisimage to test.)

addEventHandler('onClientResourceStart', resourceRoot, function()
local img = fileOpen('img.jpg')
local pixels = fileRead(img, fileGetSize(img))
local pixelsFormat = dxGetPixelsFormat(pixels)
outputChatBox('Pixels format is: ' .. pixelsFormat)
fileClose(img)
end)