Ignore:
Timestamp:
Dec 22, 2016, 2:34:33 PM (7 years ago)
Author:
chronos
Message:
  • Fixed: Memory leaks introduced by TFColor. TFColor now use reference counting as descendant of IFColor.
  • Added: Line drawing for TFPixmap class.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/gbitmap/UFormMain.pas

    r24 r25  
    2929    function RGB8Random(Position: TPoint): TColorRGB8;
    3030    function RGB16Random(Position: TPoint): TColorRGB16;
    31     function ColorRandom(Position: TPoint; ColorFormat: TColorFormat): UFGraphics.TFColor;
     31    function ColorRandom(Position: TPoint; ColorFormat: TColorFormat): IFColor;
    3232  public
    3333    procedure TestGray1;
     
    9898end;
    9999
    100 function TForm1.ColorRandom(Position: TPoint; ColorFormat: TColorFormat): UFGraphics.TFColor;
    101 begin
    102   Result := UFGraphics.TFColor.Create;
    103   Result.ColorFormat := ColorFormat;
    104   Result.SetRandom;
     100function TForm1.ColorRandom(Position: TPoint; ColorFormat: TColorFormat): IFColor;
     101begin
     102  Result := TFColor.Create;
     103  (Result as TFColor).ColorFormat := ColorFormat;
     104  (Result as TFColor).SetRandom;
    105105end;
    106106
     
    276276  with Image do begin
    277277    Size := Point(100, 100);
    278     ColorFormat := ColorFormatManager.Formats[5];
     278    ColorFormat := ColorFormatManager.Formats[2];
    279279    Fill(TFColor.Create(ColorFormat, cnWhite));
     280    Fill(ColorRandom);
    280281    Pixels[0, 0] := TFColor.Create(ColorFormat, cnBlack);
    281     Fill(ColorRandom);
     282    Canvas.Pen.Color := TFColor.Create(ColorFormat, cnBlack);
     283    Canvas.Pen.MoveTo(Point(10, 20));
     284    Canvas.Pen.LineTo(Point(60, 40));
    282285    PaintToCanvas(Image1.Picture.Bitmap.Canvas);
    283286    Label1.Caption := IntToStr(GetDataSize);
Note: See TracChangeset for help on using the changeset viewer.