Ignore:
Timestamp:
Sep 16, 2014, 11:55:35 AM (10 years ago)
Author:
chronos
Message:
  • Added: Action to fill image with random image.
  • Fixed: Pixel load/save to bitmap was using Move with pointers instead pointed value.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ColorFormats/UColorRGBA8.pas

    r3 r4  
    1818    function GetChannelBitWidth(Channel: TGColorChannel): Integer; override;
    1919    function ColorToTColor(Color: TGColor): TColor; override;
     20    procedure ColorFromTColor(GColor: TGColor; Color: TColor); override;
    2021    function GetColorClass: TGColorClass; override;
    2122  end;
     
    6667end;
    6768
     69procedure TGColorFormatRGBA8.ColorFromTColor(GColor: TGColor; Color: TColor);
     70begin
     71  PByte(GColor.Data + GetChannelBytePos(ccRed))^ := Color and $ff;
     72  PByte(GColor.Data + GetChannelBytePos(ccGreen))^ := (Color shr 8) and $ff;
     73  PByte(GColor.Data + GetChannelBytePos(ccBlue))^ := (Color shr 16) and $ff;
     74end;
     75
    6876function TGColorFormatRGBA8.GetColorClass: TGColorClass;
    6977begin
Note: See TracChangeset for help on using the changeset viewer.