ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Client functions
  3. dxSetTexturePixels

Function

dxSetTexturePixels

ClientDrawing (dx)Identical to MTA:SA

Writes pixels (plain, png, jpeg) into a texture or a render target, whole or into a section.

Syntax

bool dxSetTexturePixels(element texture, string pixels [, int surfaceIndex, int x, y, width, height])

Arguments

surfaceIndexint, optional
Surface index (compatibility).
textureelement
The texture.
pixelsstring
Pixels.
x, y, width, heightint, optional
A section.

Returns

true on success.

Example

local tex = dxCreateTexture(64, 64)
local pixels = dxGetTexturePixels(tex)
dxSetPixelColor(pixels, 10, 10, 255, 0, 0)
dxSetTexturePixels(tex, pixels)

See also