AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Aero color

Ein Thema von WojTec · begonnen am 17. Jul 2012 · letzter Beitrag vom 19. Jul 2012
 
WojTec

Registriert seit: 17. Mai 2007
480 Beiträge
 
Delphi XE6 Professional
 
#1

Aero color

  Alt 17. Jul 2012, 14:54
I want to get Aero color:

I wrote this:
Delphi-Quellcode:
var
  Params: TColorizationParams;
begin
  if IsAeroEnabled then
  begin
    if Assigned(DwmGetColorizationParameters) then
    begin
      ZeroMemory(@Params, SizeOf(Params));
      DwmGetColorizationParameters(Params);
      Result := RGB(GetBValue(Params.clrColor), GetGValue(Params.clrColor), GetRValue(Params.clrColor));
    end;
  end;
end;
It working, but because uses undocumented function (I got pointer, because I know offset), I tried again with documented function:

Delphi-Quellcode:
var
  pcrColorization: DWORD;
  pfOpaqueBlend: BOOL;
  A, R, G, B: Integer;
begin
  if IsAeroEnabled then
  begin
    if DwmGetColorizationColor(pcrColorization,pfOpaqueBlend) = S_OK then
    begin
      A := (pcrColorization and $FF000000) shr 24;
      R := (pcrColorization and $FF0000) shr 16;
      G := (pcrColorization and $FF00) shr 8;
      B := (pcrColorization and $FF);

      R := Min(255, Max(0, R + (255 - A - 40)));
      G := Min(255, Max(0, G + (255 - A - 40)));
      B := Min(255, Max(0, B + (255 - A - 40)));

      Result := RGB(R, G, B);
    end;
  end;
end;
Above formula I got from [DP]http://www.delphipraxis.net/147316-vista-win7-aero-farbe-auslesen.html[/DP]. It's not valid of course (color processing inside).

AARRGGBB, so I tried also:

Delphi-Quellcode:
  R := (pcrColorization shr 16) and $FF;
  G := (pcrColorization shr 8) and $FF;
  B := pcrColorization and $FF;
but color too dark. How to decode this color?
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 17:12 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz