source: GraphicTest/Methods/UMethodMove.pas

Last change on this file was 543, checked in by chronos, 4 years ago
  • Modified: Removed drawing methods files and classes to use Method prefix.
  • Added: TBitmap.Scanline and Move draw methods.
File size: 1.4 KB
Line 
1unit UMethodMove;
2
3{$mode delphi}
4
5interface
6
7uses
8 LCLIntf, LCLType, Classes, SysUtils, UDrawMethod, UFastBitmap, Controls, Graphics;
9
10type
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
23implementation
24
25{ TMethodMove }
26
27constructor TMethodMove.Create;
28begin
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.');
34end;
35
36destructor TMethodMove.Destroy;
37begin
38 FreeAndNil(FastBitmap2);
39 inherited Destroy;
40end;
41
42procedure TMethodMove.Init(Parent: TWinControl; Size: TPoint;
43 PixelFormat: TPixelFormat);
44begin
45 FastBitmap2.Size := Size;
46 inherited;
47end;
48
49procedure TMethodMove.UpdateSettings;
50begin
51 inherited UpdateSettings;
52end;
53
54procedure TMethodMove.DrawFrame(FastBitmap: TFastBitmap);
55var
56 Size: Integer;
57begin
58 Size := FastBitmap.Size.X * FastBitmap.Size.Y * FastPixelSize;
59 Move(FastBitmap.PixelsData^, FastBitmap2.PixelsData^, Size);
60end;
61
62
63end.
64
Note: See TracBrowser for help on using the repository browser.