Color of a screen pixel

From Rosetta Code
Revision as of 21:17, 27 May 2009 by rosettacode>Mwn3d (→‎{{header|BASIC}}: Doesn't need a function)
Task
Color of a screen pixel
You are encouraged to solve this task according to the task description, using any language you may know.

Get color information from an arbitrary pixel on the screen, such as the current location of the mouse cursor

AutoHotkey

<lang AutoHotkey> loop, 200 { MouseGetPos, MouseX, MouseY PixelGetColor, color, %MouseX%, %MouseY% TrayTip, color, color at the current cursor is %color%. sleep, 500 } </lang>

BASIC

Works with: QuickBasic version 4.5

In a graphics mode (for instance, SCREEN 13 or SCREEN 12) <lang qbasic>color = point(x, y)</lang>