| |
|
|
 Andreas Miethe
 | Per SetColorAdjustment kann man schöne Effekte mit Bildern ohne viel Aufwand realisieren ! So geht z.B. das Überblenden von Farbe nach Grau wie beim Neustart-Dialog von Windows, oder das Ausblenden nach Schwarz usw. Hier ein Beispiel, wie man Graustufen-Bilder erzeugen kann. KompilierenMarkierenSeparieren $H Windows.ph
Importdll("GDI32.DLL","")
struct COLORADJUSTMENT =
caSize%,
caFlag%,
caIlluminantIndex%,
caRedGamma%,
caGreenGamma%,
caBlueGamma%,
caReferenceBlack%,
caReferenceWhite%,
caContrast%,
caBrightness%,
caColorfulness%,
caRedGreenTint%
Var CA# = New(COLORADJUSTMENT)
Bild anlegen
Var Pic& = Create("hNewPic",%maxx,%maxy,0)
Var DC& = ~CreateCompatibleDC(%hdc)
Ausgangsbild anlegen
Var Pic1& = Create("hNewPic",%maxx,%maxy,0)
Var DC1& = ~CreateCompatibleDC(%hdc)
DC vom Desktop
Var DC2& = ~CreateDC("DISPLAY",0,0,0)
Bilder ins DC
~SelectObject(DC&,PIC&)
~SelectObject(DC1&,PIC1&)
Vom Desktop ins Ausgangsbild
dient nur dazu ein Bild zu haben !
StretchBlt(DC1&,0,0,%maxx,%maxy,DC2&,0,0,%maxx,%maxy,~SRCCOPY | $40000000)
ColorAdjustment holen
GetColorAdjustment(DC&,CA#)
Blittmode auf HALFTONE setzen
SetStretchBltMode(DC&,4)
Full Color auf Werte zwischen -100 und 100
CA#.caColorfulness% = -100 Grautöne
ColorAdjustment setzen
SetColorAdjustment(DC&,CA#)
Vom Ausgangsbild ins Bild
StretchBlt(DC&,0,0,%maxx,%maxy,DC1&,0,0,%maxx,%maxy,~SRCCOPY)
DCs freigeben
~DeleteDC(DC&)
~DeleteDC(DC1&)
~DeleteDC(DC2&)
Bild Speichern
SavePic "1.png",Pic&
Bilder freigeben
~DeleteObject(Pic&)
~DeleteObject(Pic1&)
Dispose CA#
Anzeigen
ShellExec("1.png","open",1)
./../funktionsreferenzen/xprofan/end/'>end
|
|
|
| Gruss Andreas ________ ________ ________ ________ _ Profan 3.3 - XProfanX2 Win 95,98,ME,2000,XP,Vista - Win 7 32 / 64 Bit ASUS X93S - Intel Core I7-NVIDIA GForce 540M 8GB Arbeitsspeicher Homepage : [...]  | 13.12.2009 ▲ |
|
|
|
|
 Frank Abbing | Klasse API! Kannte ich gar nicht.  |
|
|
| |
|
|
|
 p.specht
 | Fehlende Zeichen ergänzt:
$H Windows.ph
Importdll("GDI32.DLL","")
struct COLORADJUSTMENT = \
caSize%,\
caFlag%,\
caIlluminantIndex%,\
caRedGamma%,\
caGreenGamma%,\
caBlueGamma%,\
caReferenceBlack%,\
caReferenceWhite%,\
caContrast%,\
caBrightness%,\
caColorfulness%,\
caRedGreenTint%
Var CA# = New(COLORADJUSTMENT)
'Bild anlegen
Var Pic& = Create("hNewPic",%maxx,%maxy,0)
Var DC& = ~CreateCompatibleDC(%hdc)
'Ausgangsbild anlegen
Var Pic1& = Create("hNewPic",%maxx,%maxy,0)
Var DC1& = ~CreateCompatibleDC(%hdc)
'DC vom Desktop
Var DC2& = ~CreateDC("DISPLAY",0,0,0)
'Bilder ins DC
~SelectObject(DC&,PIC&)
~SelectObject(DC1&,PIC1&)
'Vom Desktop ins Ausgangsbild
'dient nur dazu ein Bild zu haben !
StretchBlt(DC1&,0,0,%maxx,%maxy,DC2&,0,0,%maxx,%maxy,~SRCCOPY | $40000000)
'ColorAdjustment holen
GetColorAdjustment(DC&,CA#)
'Blittmode auf HALFTONE setzen
SetStretchBltMode(DC&,4)
'Full Color auf Werte zwischen -100 und 100
CA#.caColorfulness% = -100'Grautöne
'ColorAdjustment setzen
SetColorAdjustment(DC&,CA#)
'Vom Ausgangsbild ins Bild
StretchBlt(DC&,0,0,%maxx,%maxy,DC1&,0,0,%maxx,%maxy,~SRCCOPY)
'DCs freigeben
~DeleteDC(DC&)
~DeleteDC(DC1&)
~DeleteDC(DC2&)
'Bild Speichern
SavePic "1.png",Pic&
'Bilder freigeben
~DeleteObject(Pic&)
~DeleteObject(Pic1&)
Dispose CA#
'Mostra
ShellExec("1.png","open",1)
end
|
|
|
| XProfan 11Computer: Gerät, daß es in Mikrosekunden erlaubt, 50.000 Fehler zu machen, zB 'daß' statt 'das'... | 18.02.2019 ▲ |
|
|
|