22 lines
598 B
Plaintext
22 lines
598 B
Plaintext
nomainwin
|
|
WindowWidth = 400
|
|
WindowHeight = 400
|
|
open "Bitmap" for graphics_nf_nsb as #1
|
|
h=hwnd(#1)
|
|
calldll #user32, "GetDC", h as ulong, DC as ulong
|
|
#1 "trapclose [q]"
|
|
loadbmp "clr","MLcolor.bmp"
|
|
#1 "drawbmp clr 1 1;flush"
|
|
for x = 1 to 150
|
|
for y = 1 to 200
|
|
calldll #gdi32, "GetPixel", DC as ulong, x as long, y as long, PX as ulong
|
|
B = int(PX/(256*256))
|
|
G = int((PX-B*256*256) / 256)
|
|
R = int(PX-B*256*256-G*256)
|
|
L = 0.2126*R+0.7152*G+0.0722*B
|
|
#1 "down;color ";L;" ";L;" ";L;";set ";x;" ";y
|
|
next y
|
|
next x
|
|
wait
|
|
[q] unloadbmp "clr":close #1:end
|