| |
|
|
Georg Teles | enclosed my View source from the Clockbar on the I straight work, the The brightness one Bildes Change can
'- Georg Teles 30.05.2018
Randomize
Declare sPic&, hPic&
Declare x&, y&'VAL: wide, Höhe
Declare h&, v&'POS: horizontal, Mouse and Sprite
CLS RGB(0,255,0)
x& = 32
y& = 32
' generiere Image
MCLS x&, y&
CLear h&, v&
StartPaint -1
WhileLoop 0,(x&*y&)-1
SetPixel h&, v&, RGB(rnd(255),rnd(255),rnd(255))
Inc h&
If h& = x&
Inc v&
Clear h&
EndIf
EndWhile
EndPaint
sPic& = Create("HPIC",0,"&MEMBMP")
' normales Image / Quellbild
DrawPic sPic&,0,0;0
' helleres Image, 200%
hPic& = brightness(sPic&, x&, y&, 200)
DrawPic hPic&,0,48;0
DeleteObject hPic&
' max. helles Image, 25500% = white
hPic& = brightness(sPic&, x&, y&, 25500)
DrawPic hPic&,48,48;0
DeleteObject hPic&
' dunkleres Image, 50%
hPic& = brightness(sPic&, x&, y&, 50)
DrawPic hPic&,0,96;0
DeleteObject hPic&
' max. dunklers Image, 0% = Black
hPic& = brightness(sPic&, x&, y&, 0)
DrawPic hPic&,48,96;0
DeleteObject hPic&
WaitInput
DeleteObject sPic&
Proc brightness
' (lever) Quellbild, (wide) Quellbild, (Höhe) Quellbild, (brightness) 0-25500
Parameters source&, x&, y&, p&
Declare bPic&, h&, v&, px&, r&, g&, b&
Clear h&, v&
MCls x&, y&
WhileLoop 0,(x&*y&)-1
'-------------------------------# read Pixel of Quellbild
StartPaint source&
px& = GetPixel(h&, v&)
r& = GetRValue(px&)
g& = GetGValue(px&)
b& = GetBValue(px&)
EndPaint
'-------------------------------#
Case r& = 0:r& = 1
Case g& = 0:g& = 1
Case b& = 0:b& = 1
'-------------------------------# draw with angepasster brightness
StartPaint -1
SetPixel h&, v&, RGB(r&*(p&/100),g&*(p&/100),b&*(p&/100))
EndPaint
'-------------------------------# horizontal / Mouse and Sprite
Inc h&
If h& = x&
Inc v&
Clear h&
EndIf
EndWhile
bPic& = Create("HPIC",0,"&MEMBMP")
Return bPic&
ENDPROC
Hello |
|
|
| |
|
|
|
| [offtopic]in this Context Perhaps too interestingly The very speedy Pixels.inc: [...] (simply The Downloads in the Topic aufklappen, there is the pkg too free ladbar) [/offtopic] |
|
|
| |
|
|