| |
|
|
 Andreas Miethe
 | Einen habe ich noch per dieses Jahr.
Bildschirm eingrauen, wie beim XP-Abmelde-Dialog. KompilierenMarkierenSeparieren $H Windows.ph
Importdll("GDI32.DLL","")
struct COLORADJUSTMENT =
caSize%,
caFlag%,
caIlluminantIndex%,
caRedGamma%,
caGreenGamma%,
caBlueGamma%,
caReferenceBlack%,
caReferenceWhite%,
caContrast%,
caBrightness%,
caColorfulness%,
caRedGreenTint%
Proc FadetoGray
windowstyle $F0
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)
Window 0,0-%maxx,%maxy
ColorAdjustment holen
GetColorAdjustment(%hdc2,CA#)
Blittmode auf HALFTONE setzen
SetStretchBltMode(%hdc2,4)
Full Color auf Werte zwischen -100 und 100
whileLoop CA#.caColorfulness%,-100,-8
CA#.caColorfulness% = &Loop Grautöne
ColorAdjustment setzen
SetColorAdjustment(%hdc2,CA#)
StretchBlt(%hdc2,0,0,%maxx,%maxy,DC1&,0,0,%maxx,%maxy,~SRCCOPY)
DrawsizedPic Pic&,0,0-%maxx,%maxy;0
Repaint
endwhile
Bilder freigeben
~DeleteDC(DC&)
~DeleteDC(DC1&)
~DeleteDC(DC2&)
~DeleteObject(Pic&)
~DeleteObject(Pic1&)
Dispose CA#
EndProc
FadeToGray()
waitinput 10000
s4 href='./../../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 : [...]  | 28.12.2009 ▲ |
|
|
|
|
 | Nett! Es hat mir den Tag vergraut.  |
|
|
| |
|
|
|
 ByteAttack | Habe den Effekt nur mit der ProSpeed hinbekommen! Sehr schön  |
|
|
| |
|
|
|
 | Oder manuell: [...] 
Ergraut den Bildschirm gestreckt auf 2 Sekunden, lässt sich naturalmente noch optimieren/beschleunigen. |
|
|
| |
|
|
|
 Andreas Miethe
 | Beschleunigen kann man es auch so KompilierenMarkierenSeparieren $H Windows.ph
Importdll("GDI32.DLL","")
struct COLORADJUSTMENT =
caSize%,
caFlag%,
caIlluminantIndex%,
caRedGamma%,
caGreenGamma%,
caBlueGamma%,
caReferenceBlack%,
caReferenceWhite%,
caContrast%,
caBrightness%,
caColorfulness%,
caRedGreenTint%
Proc FadetoGray
windowstyle $F0
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)~GetDC(GetDesktop())
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)
Window 0,0-0,0
StretchBlt(%hdc2,0,0,%maxx,%maxy,DC1&,0,0,%maxx,%maxy,~SRCCOPY)
Repaint
~Movewindow(%hwnd,0,0,%maxx,%maxy,1)
ColorAdjustment holen
GetColorAdjustment(%hdc2,CA#)
Blittmode auf HALFTONE setzen
SetStretchBltMode(%hdc2,4)
Full Color auf Werte zwischen -100 und 100
CA#.caColorfulness% = -100 Grautöne
ColorAdjustment setzen
SetColorAdjustment(%hdc2,CA#)
StretchBlt(%hdc2,0,0,%maxx,%maxy,DC1&,0,0,%maxx,%maxy,~SRCCOPY)
Repaint
Bilder freigeben
~DeleteDC(DC&)
~DeleteDC(DC1&)
~DeleteDC(DC2&)
~DeleteObject(Pic&)
~DeleteObject(Pic1&)
Dispose CA#
EndProc
FadeToGray()
waitinput 10000
ref='./../../funktionsreferenzen/xprofan/end/'>end
Das Schöne an SetColorAdjustment() ist, dass man auch Gamma-Werte,Kontraste, Helligkeit usw. sehr schnell manipulieren kann  |
|
|
| 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 : [...]  | 29.12.2009 ▲ |
|
|
|
|
 | Mit "Beschleunigen" meinte ich eher, den unperformanten Code der NProc "optimieren". ^^
Aber so viele SetColorAdjustment-Beispiel erwecken das Herz. 
Wie bekomme ich eigentlich nochmal von einem HPic ein DC auf dem dann auch z.B. SetPixel(dc,... klappt? |
|
|
| |
|
|
|
 Frank Abbing | DC mit SelectObject() anbinden. |
|
|
| |
|
|
|
 | |
|
| |
|
|
|
 | Ich bekomme mit AlphaBlend einfach keinen Nichtabsturz hin, was mache ich hier falsch?  KompilierenMarkierenSeparieren $H Windows.ph
cls
Var bm1& = ~CreateBitmap(256,256,1,32,0)
Var DC1& = ~CreateCompatibleDC(0)
~SelectObject(DC1&,bm1&)
Var bm2& = ~CreateBitmap(256,256,1,32,0)
Var DC2& = ~CreateCompatibleDC(0)
~SelectObject(DC2&,bm2&)
~bitblt(%hDc,0,0,256,256,dc1&,0,0,~SRCCOPY)
var bf&=255 * $10000 | $1000000
waitinput
~AlphaBlend(%hdc,0,0,128,128,dc1&,0,0,128,128,addr(bf&))
waitinput
| 30.12.2009 ▲ | |
|
|
|
|
 Frank Abbing | |
|
| |
|
|
|
 | Ich übergeb doch die Adresse von einem Long, aber warum obiges abstürzt, keine Ahnung... bekommst Du es zu laufen? |
|
|
| |
|
|
|
 Frank Abbing | Übergib ein LongInt, keine Adresse. In meinem Beispiel wären es:
ftn.BlendOp,0 ftn.BlendFlags,0 ftn.SourceConstantAlpha,128 ;Transparenz 0/255 ftn.AlphaFormat,0
=
0 128 0 0
=
00000000 10000000 00000000 00000000
=
%00000000100000000000000000000000
 |
|
|
| |
|
|