dxConvertPixels | Multi Theft Auto: Wiki Skip to content

dxConvertPixels

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 converts pixels from one format to another.

Syntax

dxConvertPixels ( )

Code Examples

client

The code opens an image, read its pixels, convert the pixels to PNG, and then save it. (You can usethisimage to test.)

addEventHandler('onClientResourceStart', resourceRoot, function()
local img = fileOpen('img.jpg')
local pixels = fileRead(img, fileGetSize(img))
local pngPixels = dxConvertPixels(pixels, 'png')
local newImg = fileCreate('img.png')
fileWrite(newImg, pngPixels)
fileClose(newImg)
fileClose(img)
end)