Jump to content

Draw a pixel: Difference between revisions

Added AutoHotkey
(→‎{{header|Wren}}: A bit simpler.)
(Added AutoHotkey)
Line 597:
bx lr
</lang>
 
=={{header|AutoHotkey}}==
From [https://www.autohotkey.com/boards/viewtopic.php?p=64817#p64817 AHK Forum]
<lang AutoHotkey>Gui, Add, Picture, x100 y100 w2 h2 +0x4E +HWNDhPicture
CreatePixel("FF0000", hPicture)
Gui, Show, w320 h240, Example
return
 
CreatePixel(Color, Handle) {
VarSetCapacity(BMBITS, 4, 0), Numput("0x" . Color, &BMBITS, 0, "UInt")
hBM := DllCall("Gdi32.dll\CreateBitmap", "Int", 1, "Int", 1, "UInt", 1, "UInt", 24, "Ptr", 0, "Ptr")
hBM := DllCall("User32.dll\CopyImage", "Ptr", hBM, "UInt", 0, "Int", 0, "Int", 0, "UInt", 0x2008, "Ptr")
DllCall("Gdi32.dll\SetBitmapBits", "Ptr", hBM, "UInt", 3, "Ptr", &BMBITS)
DllCall("User32.dll\SendMessage", "Ptr", Handle, "UInt", 0x172, "Ptr", 0, "Ptr", hBM)
}</lang>
 
=={{header|BASIC256}}==
299

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.