Ignore:
Timestamp:
Dec 22, 2016, 8:49:19 PM (7 years ago)
Author:
chronos
Message:
  • Modified: Updated BGRABitmap package.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • GraphicTest/Packages/bgrabitmap/bgrareadico.pas

    r472 r494  
    22
    33{$mode objfpc}{$H+}
     4{$i bgrabitmap.inc}
    45
    56interface
     
    1415  TBGRAReaderIco = class(TFPCustomImageReader)
    1516  protected
    16     procedure InternalRead(Str: TStream; Img: TFPCustomImage); override;
     17    procedure InternalRead({%H-}Str: TStream; {%H-}Img: TFPCustomImage); override;
    1718    function InternalCheck(Str: TStream): boolean; override;
    1819  public
     
    2223implementation
    2324
    24 uses BGRABitmapTypes, Graphics;
     25uses BGRABitmapTypes{$IFDEF BGRABITMAP_USE_LCL}, Graphics{$ENDIF};
    2526
    2627{ TBGRAReaderIco }
    2728
    2829procedure TBGRAReaderIco.InternalRead(Str: TStream; Img: TFPCustomImage);
     30{$IFDEF BGRABITMAP_USE_LCL}
    2931var ico: TIcon; i,bestIdx: integer;
    3032    height,width: word; format:TPixelFormat;
     
    5759    begin
    5860      ico.Current := bestIdx;
    59       with Img as TBGRACustomBitmap do
    60       begin
    61         SetSize(bestWidth,bestHeight);
    62         GetImageFromCanvas(ico.Canvas,0,0);
    63       end;
     61      (Img as TBGRACustomBitmap).Assign(ico);
    6462    end;
    6563  finally
     
    6765  end;
    6866end;
     67{$ELSE}
     68begin
     69  raise exception.create('Not implemented');
     70end;
     71{$ENDIF}
    6972
    7073function TBGRAReaderIco.InternalCheck(Str: TStream): boolean;
Note: See TracChangeset for help on using the changeset viewer.