Changeset 525


Ignore:
Timestamp:
Apr 17, 2019, 4:48:42 PM (6 years ago)
Author:
chronos
Message:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • GraphicTest/Methods/ULazIntfImageColorsCopy.pas

    r459 r525  
    1313
    1414  TLazIntfImageColorsCopy = class(TDrawMethodImage)
    15     TempIntfImage: TLazIntfImage;
    1615    constructor Create; override;
    1716    destructor Destroy; override;
     
    2827  inherited;
    2928  Caption := 'TLazIntfImage.Colors copy';
    30   TempIntfImage := TLazIntfImage.Create(0, 0);
    3129  Description.Add('Method use TLazIntfImage class for faster access to bitmap pixels compared to simple access using TBitmap.Pixels.');
    3230  Description.Add('TLazIntfImage is created from visible image.');
     
    3533destructor TLazIntfImageColorsCopy.Destroy;
    3634begin
    37   TempIntfImage.Free;
    3835  inherited Destroy;
    3936end;
     
    4239var
    4340  Y, X: Integer;
     41  TempIntfImage: TLazIntfImage;
    4442begin
    4543  with FastBitmap do begin
     44    TempIntfImage := TLazIntfImage.Create(Image.Picture.Bitmap.Width, Image.Picture.Bitmap.Height);
    4645    TempIntfImage.LoadFromBitmap(Image.Picture.Bitmap.Handle,
    4746      Image.Picture.Bitmap.MaskHandle);
     
    5049        TempIntfImage.Colors[X, Y] := TColorToFPColor(SwapBRComponent(Pixels[X, Y]));
    5150    Image.Picture.Bitmap.LoadFromIntfImage(TempIntfImage);
     51    TempIntfImage.Free;
    5252  end;
    5353end;
Note: See TracChangeset for help on using the changeset viewer.