GDI自绘调色板软件

易语言 2020-05-23 00:00:38

GDI自绘调色板软件

hDC = GetDC (画板1.取窗口句柄 ())
取当前鼠标处颜色值 (R值, G值, B值)
RR = R值
GG = G值
BB = B值
.计次循环首 (256, i2)
R = 256 - i2
G = 256 - i2
B = 256 - i2
.如果真 (RR > 0)
RR = RR - 1
.如果真结束
.如果真 (GG > 0)
GG = GG - 1
.如果真结束
.如果真 (BB > 0)
BB = BB - 1
.如果真结束
vert [1].x = 0
vert [1].y = -1 + i2
vert [1].Red = 左移 (R, 8)
vert [1].Green = 左移 (G, 8)
vert [1].Blue = 左移 (B, 8)
vert [1].Alpha = 0
vert [2].x = 350
vert [2].y = 0 + i2
vert [2].Red = 左移 (RR, 8)
vert [2].Green = 左移 (GG, 8)
vert [2].Blue = 左移 (BB, 8)
vert [2].Alpha = 0
gRect [1].UpperLeft = 0
gRect [1].LowerRight = 1
GradientFill_RECT (hDC, vert, 2, gRect, 1, #GRADIENT_FILL_RECT_H)
.计次循环尾 ()
ReleaseDC (取窗口句柄 (), hDC)