[Home] [Downloads] [Search] [Help/forum]

MUSHclient scripting

Description of MUSHclient world function: world.WindowGetPixel

Name WindowGetPixel
Type Method
Summary Gets the colour of a single pixel in a miniwindow
Prototype long WindowGetPixel(BSTR WindowName, long x, long y);

View list of data type meanings


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.

Note: Available in version 4.36 onwards.

Lua example
c = WindowGetPixel (win, 2, 3)
Returns -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.
Introduced in version 4.36

See also ...

Function Description
WindowArc Draws an arc in a miniwindow
WindowBezier Draws a B├ęzier curve in a miniwindow
WindowCircleOp Draws ellipses, filled rectangles, round rectangles, chords, pies in a miniwindow
WindowCreate Creates a miniwindow
WindowDrawImage Draws an image into a miniwindow
WindowLine Draws a line in a miniwindow
WindowPolygon Draws a polygon in a miniwindow
WindowRectOp Draws a rectangle in a miniwindow
WindowSetPixel Sets a single pixel in a miniwindow to the specified colour

Search for script function

Enter a word or phrase in the box below to narrow the list down to those that match.

The function name, prototype, summary, and description are searched.

Search for:   

Leave blank to show all functions.

Return codes

Many functions return a "code" which indicates the success or otherwise of the function.

You can view a list of the return codes

Function prototypes

The "prototype" part of each function description lists exactly how the function is called (what arguments, if any, to pass to it).

You can view a list of the data types used in function prototypes

View all functions


Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]