-
-
Notifications
You must be signed in to change notification settings - Fork 33
/
zint_render_fmx_bmp.pas
59 lines (45 loc) · 1.11 KB
/
zint_render_fmx_bmp.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
unit zint_render_fmx_bmp;
{
Based on Zint (done by Robin Stuart and the Zint team)
http://github.com/zint/zint
Translation by TheUnknownOnes
http://theunknownones.net
License: Apache License 2.0
}
interface
uses
zint, zint_render_fmx_canvas, FMX.Types, FMX.Graphics;
type
TZintBMPRenderTarget = class(TZintCanvasRenderTarget)
private
FBitmap: TBitmap;
procedure SetBitmap(const Value: TBitmap);
protected
FBMP : TBitmap;
procedure DrawStop; override;
procedure Inflate(const ANewWidth, ANewHeight : Single); override;
public
property Bitmap: TBitmap read FBitmap write SetBitmap;
end;
implementation
{ TZintBMPRenderTarget }
procedure TZintBMPRenderTarget.DrawStop;
begin
inherited;
end;
procedure TZintBMPRenderTarget.Inflate(const ANewWidth, ANewHeight : Single);
begin
FBMP.Height:=Round(ANewHeight);
FBMP.Width:=Round(ANewWidth);
end;
procedure TZintBMPRenderTarget.SetBitmap(const Value: TBitmap);
begin
FBitmap := Value;
if Assigned(Value) then
begin
FWidthDesired:=Value.Width;
FHeightDesired:=Value.Height;
Canvas:=Value.Canvas;
end;
end;
end.