source: trunk/Methods/UMethodBitmapRawImageDataMove.pas

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