| Line | |
|---|
| 1 | unit GenericBitmap;
|
|---|
| 2 |
|
|---|
| 3 | {$mode delphi}
|
|---|
| 4 |
|
|---|
| 5 | interface
|
|---|
| 6 |
|
|---|
| 7 | uses
|
|---|
| 8 | GenericMatrix;
|
|---|
| 9 |
|
|---|
| 10 | type
|
|---|
| 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 |
|
|---|
| 25 | implementation
|
|---|
| 26 |
|
|---|
| 27 | function TGBitmap<T>.GetWidth: Integer;
|
|---|
| 28 | begin
|
|---|
| 29 | Result := Count.X;
|
|---|
| 30 | end;
|
|---|
| 31 |
|
|---|
| 32 | function TGBitmap<T>.GetHeight: Integer;
|
|---|
| 33 | begin
|
|---|
| 34 | Result := Count.Y;
|
|---|
| 35 | end;
|
|---|
| 36 |
|
|---|
| 37 | procedure TGBitmap<T>.SetWidth(Value: Integer);
|
|---|
| 38 | begin
|
|---|
| 39 | Count := CreateIndex(Value, Count.Y);
|
|---|
| 40 | end;
|
|---|
| 41 |
|
|---|
| 42 | procedure TGBitmap<T>.SetHeight(Value: Integer);
|
|---|
| 43 | begin
|
|---|
| 44 | Count := CreateIndex(Count.X, Value);
|
|---|
| 45 | end;
|
|---|
| 46 |
|
|---|
| 47 | end.
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.