English
Source / code snippets

brightness, Image, Bildhandle

 

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
 
XProfan X3
TC-Programming [...] 
XProfan 8.0 - 10.0 - X2 - X3 - X4

05/30/18  
 



[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]
 
05/31/18  
 



Zum Quelltext


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

3.058 Views

Untitledvor 0 min.
Walter04/11/23
H.Brill02/10/22
Stringray01/05/22
Georg Teles12/30/20
More...

Themeninformationen

this Topic has 2 subscriber:

iF (1x)
Georg Teles (1x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie