.setpixel Method

Function:

Directly writes pixel data for a single pixel into the controller's memory.

Syntax:

lcd.setpixel(dt as word, x as word, y as word)

Returns:

---

See Also:

Working With Pixels and Colors, Understanding Controller Properties


Part

Description

dt

Pixel data to write.

x

X coordinate of the pixel. Value range is 0 to lcd.width - 1.

y

Y coordinate of the pixel. Value range is 0 to lcd.height - 1.


Details

The interpretation of the dt argument depends on the selected controller/panel. Selection is made through the Customize Project dialog, accessible through the Project Settings dialog.

The dt argument is of the word type, but only lcd.bitsperpixel lower bits of this value will be relevant. All higher bits will be ignored.

For monochrome and grayscale controllers/panels (lcd.paneltype = 0 — PL_LCD_PANELTYPE_GRAYSCALE), the value of the dt argument sets the brightness of the pixel. For color panels/controllers (lcd.paneltype = 1 — PL_LCD_PANELTYPE_COLOR), the value is composed of three fields — one for the red, green, and blue "channels." Check the lcd.redbits, lcd.greenbits, and lcd.bluebits properties to see how the fields are combined into the dt word.

The display panel must be enabled (lcd.enabled = 1 — YES) for this method to work.


.setpixel Method

Details