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