world.WindowGetPixel
Gets the colour of a single pixel in a miniwindow
Prototype
long WindowGetPixel(BSTR WindowName, long x, long y);
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
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 |