1 | unit UMethodMove;
|
---|
2 |
|
---|
3 | {$mode delphi}
|
---|
4 |
|
---|
5 | interface
|
---|
6 |
|
---|
7 | uses
|
---|
8 | LCLIntf, LCLType, Classes, SysUtils, UDrawMethod, UFastBitmap, Controls, Graphics;
|
---|
9 |
|
---|
10 | type
|
---|
11 | { TMethodMove }
|
---|
12 |
|
---|
13 | TMethodMove = class(TDrawMethod)
|
---|
14 | FastBitmap2: TFastBitmap;
|
---|
15 | constructor Create; override;
|
---|
16 | destructor Destroy; override;
|
---|
17 | procedure Init(Parent: TWinControl; Size: TPoint; PixelFormat: TPixelFormat); override;
|
---|
18 | procedure UpdateSettings; override;
|
---|
19 | procedure DrawFrame(FastBitmap: TFastBitmap); override;
|
---|
20 | end;
|
---|
21 |
|
---|
22 |
|
---|
23 | implementation
|
---|
24 |
|
---|
25 | { TMethodMove }
|
---|
26 |
|
---|
27 | constructor TMethodMove.Create;
|
---|
28 | begin
|
---|
29 | inherited Create;
|
---|
30 | FastBitmap2 := TFastBitmap.Create;
|
---|
31 | Caption := 'Move';
|
---|
32 | Description.Add('This method doesn''t draw anything. Measurement of memory copy' +
|
---|
33 | ' of bitmap data using Move procedure.');
|
---|
34 | end;
|
---|
35 |
|
---|
36 | destructor TMethodMove.Destroy;
|
---|
37 | begin
|
---|
38 | FreeAndNil(FastBitmap2);
|
---|
39 | inherited Destroy;
|
---|
40 | end;
|
---|
41 |
|
---|
42 | procedure TMethodMove.Init(Parent: TWinControl; Size: TPoint;
|
---|
43 | PixelFormat: TPixelFormat);
|
---|
44 | begin
|
---|
45 | FastBitmap2.Size := Size;
|
---|
46 | inherited;
|
---|
47 | end;
|
---|
48 |
|
---|
49 | procedure TMethodMove.UpdateSettings;
|
---|
50 | begin
|
---|
51 | inherited UpdateSettings;
|
---|
52 | end;
|
---|
53 |
|
---|
54 | procedure TMethodMove.DrawFrame(FastBitmap: TFastBitmap);
|
---|
55 | var
|
---|
56 | Size: Integer;
|
---|
57 | begin
|
---|
58 | Size := FastBitmap.Size.X * FastBitmap.Size.Y * FastPixelSize;
|
---|
59 | Move(FastBitmap.PixelsData^, FastBitmap2.PixelsData^, Size);
|
---|
60 | end;
|
---|
61 |
|
---|
62 |
|
---|
63 | end.
|
---|
64 |
|
---|