Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Hot Soup Processor

Name: Anonymous 2020-05-24 16:40

It's a very popular Japanese programming language still in use today by game developers
Why does it have a silly name?

Name: Anonymous 2020-05-24 20:55

/*
Simple Color Code Picker Sample for HSP
by Kpan
*/

#include "user32.as"
#include "gdi32.as"

#define ctype GetRValue(%1) %1 & $FF
#define ctype GetGValue(%1) (%1 >> 8) & $FF
#define ctype GetBValue(%1) (%1 >> 16) & $FF

; main window (Window ID : 0)
screen 0, 130, 50
title "Color Code Picker"

; jump label for WM_CLOSE
onexit gosub *exit

; always window on top
gsel 0, 2

; one-line edit control (Object ID : 0)
pos 50, 15
input value, 70, 20

; get a handle to device context
GetDC 0
hdc_display = stat

repeat
; temporarily stop drawing
redraw 0

color 255, 255, 255
boxf 0, 0, 50, 50

; get rgb color value
GetPixel hdc_display, ginfo(0), ginfo(1)
clr_rgb = stat

color GetRValue(clr_rgb), GetGValue(clr_rgb), GetBValue(clr_rgb)
boxf 10, 10, 40, 40

; update edit control
objprm 0, strf("#%06X", clr_rgb)

; restart drawing
redraw 1

wait 10
loop


*exit
ReleaseDC 0, hdc_display

end

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List