world.WindowGetPixel

MUSHclient script function (Method) — introduced in version 4.36

Gets the colour of a single pixel in a miniwindow

Prototype

long WindowGetPixel(BSTR WindowName, long x, long y);

Data type meanings

Description

Gets a single pixel colour from the miniwindow.

WindowName - the name of an existing miniwindow.

x, y - the location of the pixel (x is horizontal, y is vertical)

Note that after doing a WindowSetPixel, if you do a WindowGetPixel you will not necessarily get back the same value, particularly if the screen monitor resolution is set to 16 bit colour or less.

Lua example

c = WindowGetPixel (win, 2, 3)

Return value

-1 if the pixel is out of the range of the window size.

-2 if the miniwindow does not exist.

Otherwise: The colour at that location as an RGB code.

Related topic

MiniWindows

See also

FunctionDescription
WindowArcDraws an arc in a miniwindow
WindowBezierDraws a Bézier curve in a miniwindow
WindowCircleOpDraws ellipses, filled rectangles, round rectangles, chords, pies in a miniwindow
WindowCreateCreates a miniwindow
WindowDrawImageDraws an image into a miniwindow
WindowLineDraws a line in a miniwindow
WindowPolygonDraws a polygon in a miniwindow
WindowRectOpDraws a rectangle in a miniwindow
WindowSetPixelSets a single pixel in a miniwindow to the specified colour