dxGetTexturePixels | Multi Theft Auto: Wiki Skip to content

dxGetTexturePixels

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 fetches the pixels from a texture element. It can be used with a standard texture, render target or screen source.

Note

This function is slow and not something you want to be doing once a frame. It is slower when reading pixels from a render target or screen source. And is very slow indeed if the texture format is not 'argb' (unless the native ' dds' format is used with correct options).

Important

If the user has not enabled screen uploading in the settings, the function will use a 32x32 empty texture as a basis.

Syntax

dxGetTexturePixels ( )

Code Examples

client
local mtaLogo = dxCreateTexture("mta-logo.png")
outputChatBox("MTA logo pixels is: "..dxGetTexturePixels(mtaLogo))