Changeset 6 for os/trunk/Xvcl


Ignore:
Timestamp:
Jun 2, 2013, 5:41:42 PM (12 years ago)
Author:
chronos
Message:
Location:
os/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • os/trunk

    • Property svn:ignore
      •  

        old new  
        22*.~dsk
        33__history
         4*.identcache
  • os/trunk/Xvcl/Xvcl.Graphics.pas

    r5 r6  
    1010  TColor = (clNone, clBlack, clWhite, clGray, clSilver, clBlue, clGreen, clRed,
    1111    clLightBlue, clLightRed, clLightGreen, clBrown, clYellow, clMagenta, clCyan);
     12  PColor = ^TColor;
    1213
    1314  TPen = class
     
    6263  TBitmap = class
    6364  private
     65    Data: PByte;
     66    FSize: TPoint;
    6467    function GetPixel(X, Y: Integer): TColor;
    6568    procedure SetPixel(X, Y: Integer; const Value: TColor);
     69    procedure SetSize(const Value: TPoint);
    6670  public
    6771    property Pixels[X, Y: Integer]: TColor read GetPixel write SetPixel;
     72    property Size: TPoint read FSize write SetSize;
    6873  end;
    6974
     
    150155function TBitmap.GetPixel(X, Y: Integer): TColor;
    151156begin
    152 
     157  Result := PColor(Data + (X + Y * Size.X) * SizeOf(TColor))^;
    153158end;
    154159
    155160procedure TBitmap.SetPixel(X, Y: Integer; const Value: TColor);
    156161begin
    157 
    158 end;
    159 
     162  PColor(Data + (X + Y * Size.X) * SizeOf(TColor))^ := Value;
     163end;
     164
     165
     166procedure TBitmap.SetSize(const Value: TPoint);
     167begin
     168  FSize := Value;
     169end;
    160170
    161171{ TVideoDevice }
Note: See TracChangeset for help on using the changeset viewer.