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 | |
---|
1 | unit MethodBitmapRawImageDataMove;
|
---|
2 |
|
---|
3 | interface
|
---|
4 |
|
---|
5 | uses
|
---|
6 | Classes, SysUtils, DrawMethod, FastBitmap, Graphics, GraphType;
|
---|
7 |
|
---|
8 | type
|
---|
9 | { TMethodBitmapRawImageDataMove }
|
---|
10 |
|
---|
11 | TMethodBitmapRawImageDataMove = class(TDrawMethodImage)
|
---|
12 | constructor Create; override;
|
---|
13 | procedure DrawFrame(FastBitmap: TFastBitmap); override;
|
---|
14 | end;
|
---|
15 |
|
---|
16 |
|
---|
17 | implementation
|
---|
18 |
|
---|
19 | { TMethodBitmapRawImageDataMove }
|
---|
20 |
|
---|
21 | constructor TMethodBitmapRawImageDataMove.Create;
|
---|
22 | begin
|
---|
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.');
|
---|
28 | end;
|
---|
29 |
|
---|
30 | procedure TMethodBitmapRawImageDataMove.DrawFrame(FastBitmap: TFastBitmap);
|
---|
31 | var
|
---|
32 | RowPtr: PInteger;
|
---|
33 | RawImage: TRawImage;
|
---|
34 | BytePerRow: Integer;
|
---|
35 | begin
|
---|
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;
|
---|
46 | end;
|
---|
47 |
|
---|
48 | end.
|
---|
49 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.