source: Generics/NativeGenerics/Generic/GenericBitmap.pas

Last change on this file was 496, checked in by chronos, 6 years ago
  • Modified: New native generics classes working under FPC 3.0 transformed from TemplateGenerics package.
File size: 849 bytes
Line 
1unit GenericBitmap;
2
3{$mode delphi}
4
5interface
6
7uses
8 GenericMatrix;
9
10type
11 TGBitmap<T> = class(TGMatrix<T>)
12 private
13 function GetWidth: Integer;
14 function GetHeight: Integer;
15 procedure SetWidth(Value: Integer);
16 procedure SetHeight(Value: Integer);
17 public
18 property Pixels[X, Y: Integer]: T
19 read GetItemXY write PutItemXY;
20 property Width: Integer read GetWidth write SetWidth;
21 property Height: Integer read GetHeight write SetHeight;
22 end;
23
24
25implementation
26
27function TGBitmap<T>.GetWidth: Integer;
28begin
29 Result := Count.X;
30end;
31
32function TGBitmap<T>.GetHeight: Integer;
33begin
34 Result := Count.Y;
35end;
36
37procedure TGBitmap<T>.SetWidth(Value: Integer);
38begin
39 Count := CreateIndex(Value, Count.Y);
40end;
41
42procedure TGBitmap<T>.SetHeight(Value: Integer);
43begin
44 Count := CreateIndex(Count.X, Value);
45end;
46
47end.
Note: See TracBrowser for help on using the repository browser.