Ignore:
Timestamp:
Dec 8, 2023, 11:39:45 PM (5 months ago)
Author:
chronos
Message:
  • Added: Range checking for TPixelPointer record type.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Packages/DpiControls/Dpi.Graphics.pas

    r477 r487  
    270270    procedure ScreenChanged; override;
    271271  public
     272    procedure Assign(Source: TPersistent); override;
    272273    procedure SetSize(AWidth, AHeight: Integer); override;
    273274  end;
     
    293294    constructor Create; override;
    294295    destructor Destroy; override;
    295     procedure Assign(Source: TPersistent); override;
    296296    property ScanLine[Row: Integer]: Pointer read GetScanLine;
    297297  published
     
    418418end;
    419419
     420procedure TCustomBitmap.Assign(Source: TPersistent);
     421begin
     422  if Source is TCustomBitmap then begin
     423    GetNativeCustomBitmap.Assign(TCustomBitmap(Source).GetNativeCustomBitmap);
     424    FWidth := TCustomBitmap(Source).FWidth;
     425    FHeight := TCustomBitmap(Source).FHeight
     426  end else inherited;
     427end;
     428
    420429procedure TCustomBitmap.SetSize(AWidth, AHeight: Integer);
    421430begin
     
    691700  //Exit;
    692701  Dst.BeginUpdate;
    693   SrcPtr := PixelPointer(Src, 0, 0);
    694   DstPtr := PixelPointer(Dst, 0, 0);
     702  SrcPtr := TPixelPointer.Create(Src, 0, 0);
     703  DstPtr := TPixelPointer.Create(Dst, 0, 0);
    695704  {for yy := 0 to Dst.Height - 1 do begin
    696705    for xx := 0 to Dst.Width - 1 do begin
     
    841850end;
    842851
    843 procedure TBitmap.Assign(Source: TPersistent);
    844 begin
    845   if Source is TBitmap then begin
    846     GetNativeBitmap.Assign((Source as TBitmap).GetNativeBitmap);
    847   end else inherited;
    848 end;
    849 
    850852{ TPen }
    851853
Note: See TracChangeset for help on using the changeset viewer.