Skip to content

Commit ee7981a

Browse files
author
error
committed
fix ColorToAlphaColor
1 parent f9b85d8 commit ee7981a

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Source/ES.ExGraphics.pas

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,13 +111,13 @@ TEsBitMap = class(TBitmap)
111111
end;
112112

113113
// Utils
114-
function ColorToAlphaColor(Color: TColor; Alpha: Byte = 255): TAlphaColor; Inline;
114+
function ColorToAlphaColor(Color: TColor; Alpha: Byte = 255): TAlphaColor; inline;
115115
function AlphaColorToColor(Color: TAlphaColor): TColor; Inline;
116116
procedure DrawBitmapHighQuality(Handle: THandle; ARect: TRect; Bitmap: TBitmap; Opacity: Byte = 255;
117117
HighQality: Boolean = False; EgdeFill: Boolean = False);
118118
procedure PngImageAssignToBitmap(Bitmap: TBitmap; PngImage: TPngImage; IsPremultipledBitmap: Boolean = True);
119119
procedure BitmapAssignToPngImage(PngImage: TPngImage; Bitmap: TBitmap; IsPremultipledBitmap: Boolean = True);
120-
procedure GraphicAssignToBitmap(Bitmap: TBitmap; Graphic: TGraphic); Inline;
120+
procedure GraphicAssignToBitmap(Bitmap: TBitmap; Graphic: TGraphic); inline;
121121
{$IFDEF USE_GDIPLUS}
122122
function BitmapToGPBitmap(Bitmap: TBitmap): TGPBitmap;
123123
{$ENDIF}
@@ -179,7 +179,7 @@ implementation
179179

180180
function ColorToAlphaColor(Color: TColor; Alpha: Byte = 255): TAlphaColor;
181181
begin
182-
Result := ((Color shl 16) and $00FF0000) or ((Color shr 16) and $000000FF) or (Color and $0000FF00) or (Alpha shl 24);
182+
Result := ((Cardinal(Color) shl 16) and $00FF0000) or ((Cardinal(Color) shr 16) and $000000FF) or (Cardinal(Color) and $0000FF00) or (Alpha shl 24);
183183
end;
184184

185185
function AlphaColorToColor(Color: TAlphaColor): TColor;

0 commit comments

Comments
 (0)