source: GraphicTest/Methods/MethodMove.pas

Last change on this file was 573, checked in by chronos, 5 months ago
  • Modified: Build with Lazarus 3.4.
  • Modified: Removed U prefix from unit names.
File size: 1.3 KB
Line 
1unit MethodMove;
2
3interface
4
5uses
6 LCLIntf, LCLType, Classes, SysUtils, DrawMethod, FastBitmap, Controls, Graphics;
7
8type
9 { TMethodMove }
10
11 TMethodMove = class(TDrawMethod)
12 FastBitmap2: TFastBitmap;
13 constructor Create; override;
14 destructor Destroy; override;
15 procedure Init(Parent: TWinControl; Size: TPoint; PixelFormat: TPixelFormat); override;
16 procedure UpdateSettings; override;
17 procedure DrawFrame(FastBitmap: TFastBitmap); override;
18 end;
19
20
21implementation
22
23{ TMethodMove }
24
25constructor TMethodMove.Create;
26begin
27 inherited;
28 FastBitmap2 := TFastBitmap.Create;
29 Caption := 'Move';
30 Description.Add('This method doesn''t draw anything. Measurement of memory copy' +
31 ' of bitmap data using Move procedure.');
32end;
33
34destructor TMethodMove.Destroy;
35begin
36 FreeAndNil(FastBitmap2);
37 inherited;
38end;
39
40procedure TMethodMove.Init(Parent: TWinControl; Size: TPoint;
41 PixelFormat: TPixelFormat);
42begin
43 FastBitmap2.Size := Size;
44 inherited;
45end;
46
47procedure TMethodMove.UpdateSettings;
48begin
49 inherited;
50end;
51
52procedure TMethodMove.DrawFrame(FastBitmap: TFastBitmap);
53var
54 Size: Integer;
55begin
56 Size := FastBitmap.Size.X * FastBitmap.Size.Y * FastPixelSize;
57 Move(FastBitmap.PixelsData^, FastBitmap2.PixelsData^, Size);
58end;
59
60end.
61
Note: See TracBrowser for help on using the repository browser.