English
Source / code snippets

Setcoloradjustment

 

Andreas
Miethe


Per SetColorAdjustment can nice effects with pictures without plenty hoisted release !
so goes z.B. the Überblenden of colour to gray How at Neustart-dialog Windows, or the Invisible to Black etc.
here an example, How one Graustufen-Images produce can.
CompileMarkSeparation
 $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)
./../Function-References/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 :  [...] 
12/13/09  
 




Frank
Abbing
class API! Kannte I none.
 
12/13/09  
 




p.specht

Fehlende characters complement:
 $H windows.ph
Importdll("GDI32.DLL","")
struct  COLORADJUSTMENT = \
caSize%,\
caFlag%,\
caIlluminantIndex%,\
caRedGamma%,\
caGreenGamma%,\
caBlueGamma%,\
caReferenceBlack%,\
caReferenceWhite%,\
caContrast%,\
caBrightness%,\
caColorfulness%,\
caRedGreenTint%
Var CA# = New(COLORADJUSTMENT)
'Image lay out
Var Pic& = Create("hNewPic",%maxx,%maxy,0)
Var DC& = ~CreateCompatibleDC(%hdc)
'Ausgangsbild lay out
Var Pic1& = Create("hNewPic",%maxx,%maxy,0)
Var DC1& = ~CreateCompatibleDC(%hdc)
'DC of Desktop
Var DC2& = ~CreateDC("DISPLAY",0,0,0)
'Images in that DC
~SelectObject(DC&,PIC&)
~SelectObject(DC1&,PIC1&)
'of Desktop in that Ausgangsbild
'serves only to a Image to have !
StretchBlt(DC1&,0,0,%maxx,%maxy,DC2&,0,0,%maxx,%maxy,~SRCCOPY | $40000000)
'ColorAdjustment fetch
GetColorAdjustment(DC&,CA#)
'Blittmode on HALFTONE settle
SetStretchBltMode(DC&,4)
'Full Color on values between -100 and 100
CA#.caColorfulness% = -100'Grautöne
'ColorAdjustment settle
SetColorAdjustment(DC&,CA#)
'of Ausgangsbild in that Image
StretchBlt(DC&,0,0,%maxx,%maxy,DC1&,0,0,%maxx,%maxy,~SRCCOPY)
'DCs enable
~DeleteDC(DC&)
~DeleteDC(DC1&)
~DeleteDC(DC2&)
'Save picture
SavePic "1.png",Pic&
'Images enable
~DeleteObject(Pic&)
~DeleteObject(Pic1&)
Dispose CA#
'Show
ShellExec("1.png","open",1)
end
 
XProfan 11
Computer: Gerät, daß es in Mikrosekunden erlaubt, 50.000 Fehler zu machen, zB 'daß' statt 'das'...
02/18/19  
 



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

5.679 Views

Untitledvor 0 min.
Axel Berse11/08/23
RudiB.04/22/21
Stefan8103/15/21
N.Art11/18/20
More...

Themeninformationen



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