Ignore:
Timestamp:
Dec 28, 2021, 5:00:37 PM (2 years ago)
Author:
chronos
Message:
  • Modified: Update Common package to version 0.9.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Packages/Common/UPixelPointer.pas

    r77 r83  
    1515  private
    1616    procedure SetRGB(AValue: Cardinal);
     17    function GetRGB: Cardinal;   
    1718  public
    18     function GetRGB: Cardinal;
    1919    property RGB: Cardinal read GetRGB write SetRGB;
    2020    case Integer of
     
    5757  function Color32ToPixel32(Color: TColor32): TPixel32;
    5858  function Pixel32ToColor32(Color: TPixel32): TColor32;
     59  function Color32ToColor(Color: TColor32): TColor;
     60  function ColorToColor32(Color: TColor): TColor32;
    5961
    6062implementation
     
    136138var
    137139  SrcPtr, DstPtr: TPixelPointer;
    138   SubPtr: TPixelPointer;
    139140  X, Y: Integer;
    140141  XX, YY: Integer;
     
    281282end;
    282283
     284function Color32ToColor(Color: TColor32): TColor;
     285begin
     286  Result := ((Color shr 16) and $ff) or (Color and $00ff00) or
     287    ((Color and $ff) shl 16);
     288end;
     289
     290function ColorToColor32(Color: TColor): TColor32;
     291begin
     292  Result := $ff000000 or ((Color shr 16) and $ff) or (Color and $00ff00) or
     293    ((Color and $ff) shl 16);
     294end;
     295
    283296function PixelPointer(Bitmap: TRasterImage; BaseX: Integer;
    284297  BaseY: Integer): TPixelPointer;
Note: See TracChangeset for help on using the changeset viewer.