- Documentation
- Client functions
- dxSetTexturePixels
Function
dxSetTexturePixels
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
dxGetTexturePixelsReads the pixels of a texture, a render target or a screen source inplain,pngorjpegformat, whole or from a section (x, y, width, height). For example for a screenshot.dxSetPixelColorSets the colour of pixel (x, y) inplainpixels and changes the passed string. Images smaller than 4x4 are rejected.