dxGetPixelsSize | Multi Theft Auto: Wiki Skip to content

dxGetPixelsSize

Client-side
Server-side
Shared

This page is incomplete! Help wanted!

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


This function gets the dimensions of pixels contained in a string. It works with all pixel formats.

Syntax

dxGetPixelsSize ( )

Code Examples

client

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

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