source: GraphicTest/Methods/MethodBitmapRawImageDataMove.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.2 KB
Line 
1unit MethodBitmapRawImageDataMove;
2
3interface
4
5uses
6 Classes, SysUtils, DrawMethod, FastBitmap, Graphics, GraphType;
7
8type
9 { TMethodBitmapRawImageDataMove }
10
11 TMethodBitmapRawImageDataMove = class(TDrawMethodImage)
12 constructor Create; override;
13 procedure DrawFrame(FastBitmap: TFastBitmap); override;
14 end;
15
16
17implementation
18
19{ TMethodBitmapRawImageDataMove }
20
21constructor TMethodBitmapRawImageDataMove.Create;
22begin
23 inherited;
24 Caption := 'TBitmap.RawImage.Data Move';
25 Description.Add('This is same as BitmapRawImageData but data is not converted from different format. ' +
26 'But only moved to TImage raw data. ' +
27 'Then TImage is responsible for show loaded data.');
28end;
29
30procedure TMethodBitmapRawImageDataMove.DrawFrame(FastBitmap: TFastBitmap);
31var
32 RowPtr: PInteger;
33 RawImage: TRawImage;
34 BytePerRow: Integer;
35begin
36 with FastBitmap do
37 try
38 Image.Picture.Bitmap.BeginUpdate(False);
39 RawImage := Image.Picture.Bitmap.RawImage;
40 RowPtr := PInteger(RawImage.Data);
41 BytePerRow := RawImage.Description.BytesPerLine;
42 Move(FastBitmap.PixelsData^, RowPtr^, Size.Y * BytePerRow);
43 finally
44 Image.Picture.Bitmap.EndUpdate(False);
45 end;
46end;
47
48end.
49
Note: See TracBrowser for help on using the repository browser.