Last active
December 31, 2015 14:19
-
-
Save freeonterminate/7999844 to your computer and use it in GitHub Desktop.
ARGB でも ABGR でも正しい色を返す
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ARGB を ABGR に変換 | |
// IsRev が True の時 ABGR(PixelFormat が pfA8B8G8R8) | |
function GetColor(const iColor: TAlphaColor): TAlphaColor; | |
{$IFDEF CPUX86} | |
asm | |
cmp byte ptr IsRev, 0 | |
jz @@exit | |
rol eax, 8 | |
bswap eax | |
@@exit: | |
end; | |
{$ELSE} | |
begin | |
if (IsRev) then | |
Result := RGBtoBGR(iColor) // System.UIConst に定義 | |
else | |
Result := iColor; | |
end; | |
{$ENDIF} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment