UpdateImagePixels

Category: Images and Rendering

Back to System Functions


Signature

UpdateImagePixels(imageReference As Integer, pixels() As Integer)

Returns

Void

Description

Updates an image from a one-dimensional Integer array of ARGB values (0xAARRGGBB).

The array length must exactly match ImageWidth(imageReference) * ImageHeight(imageReference).

If the array length is incorrect, LunarBasic raises a runtime error with expected and actual pixel counts and source location details.

This function updates regular images only and does not accept buffer render targets.

Example

Dim imageRef As Integer Dim pixels(1) As Integer imageRef = LoadImage("tiles.png") LoadImagePixels(imageRef, pixels) UpdateImagePixels(imageRef, pixels)