Changeset 32 for trunk


Ignore:
Timestamp:
Jan 4, 2017, 11:54:15 PM (8 years ago)
Author:
chronos
Message:
  • Added: Drwing to 1-bit gray image.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Packages/FastGraphics/ColorFormats/UColorGray1.pas

    r30 r32  
    3030    constructor Create(Color: TColorGray1);
    3131    procedure SetColorName(ColorName: TColorName); override;
     32    procedure SetColor(Color: TColor); override;
    3233    procedure SetRandom; override;
    3334  end;
     
    4546  public
    4647    Pixmap: TPixmapGray1;
     48    procedure Mirror; override;
     49    procedure Flip; override;
    4750    procedure Fill(Color: IBColor); override;
    4851    procedure Fill(Func: TGetColorPos); override;
     
    103106end;
    104107
     108procedure TBColorGray1.SetColor(Color: TColor);
     109begin
     110  Value := Trunc((((Color shr 16) and $ff) + ((Color shr 8) and $ff) + ((Color shr 0) and $ff)) / $300 * 2)
     111end;
     112
    105113procedure TBColorGray1.SetRandom;
    106114begin
     
    129137begin
    130138  Pixmap.Pixels[X, Y] := (AValue as TBColorGray1).Value;
     139end;
     140
     141procedure TBPixmapGray1.Mirror;
     142begin
     143  Pixmap.Mirror;
     144end;
     145
     146procedure TBPixmapGray1.Flip;
     147begin
     148  Pixmap.Flip;
    131149end;
    132150
Note: See TracChangeset for help on using the changeset viewer.