1 unit ubgrasamples;
2 
3 {$mode objfpc}{$H+}
4 
5 interface
6 
7 uses
8   Classes, SysUtils, Controls, Graphics,
9   BGRABitmapTypes, BGRABitmap, BGRAGradients;
10 
11 { Drawings }
12 procedure DrawFlashPlayerBody(ABitmap: TBGRABitmap);
13 procedure DrawFlashPlayerButtonPanel(ABitmap: TBGRABitmap);
14 procedure DrawWin7ToolBar(ABitmap: TBGRABitmap; ADir: TAlign);
15 
16 implementation
17 
18 { Drawings }
19 
20 procedure DrawFlashPlayerBody(ABitmap: TBGRABitmap);
21 begin
22   with ABitmap do begin
23     GradientFill(0,0,Width,Height,BGRA(203,19,23,255),BGRA(110,3,20,255),
24     gtLinear,PointF(0,0),PointF(0,Height),dmSet);
25     Rectangle(0,0,Width,Height+1,BGRA(0,0,0,215),dmDrawWithTransparency);
26   end;
27 end;
28 
29 procedure DrawFlashPlayerButtonPanel(ABitmap: TBGRABitmap);
30 begin
31   with ABitmap do begin
32     DrawHorizLine(0,0,Width,BGRA(30,30,30,255));
33     DrawHorizLine(0,Height-1,Width,BGRA(62,62,62,255));
34     Rectangle(0,1,Width,Height-1,BGRA(91,91,91,255),BGRA(76,76,76,255),dmSet);
35   end;
36 end;
37 
38 procedure DrawWin7ToolBar(ABitmap: TBGRABitmap; ADir: TAlign);
39 var
40   tempBmp: TBGRABitmap;
41 begin
42   tempBmp := DoubleGradientAlphaFill(Rect(0,0,ABitmap.Width,ABitmap.Height),
43   BGRA(245,250,255,255),BGRA(230,240,250,255),
44   BGRA(220,230,244,255),BGRA(221,233,247,255),
45   gdVertical,gdVertical,gdVertical,0.50);
46   ABitmap.PutImage(0,0,tempBmp,dmSet);
47   tempBmp.Free;
48   case ADir of
49     alLeft :  with ABitmap do begin
50       Rectangle(0,0,Width-2,Height,BGRA(255,255,255,100),dmDrawWithTransparency);
51       SetVertLine(Width-1,0,Height-1,BGRA(160,175,195,255));
52       SetVertLine(Width-2,0,Height-1,BGRA(205,218,234,255));
53     end;
54     alTop : with ABitmap do begin
55       Rectangle(0,0,Width,Height-2,BGRA(255,255,255,100),dmDrawWithTransparency);
56       SetHorizLine(0,Height-1,Width-1,BGRA(160,175,195,255));
57       SetHorizLine(0,Height-2,Width-1,BGRA(205,218,234,255));
58     end;
59     alRight : with ABitmap do begin
60       Rectangle(2,0,Width,Height,BGRA(255,255,255,100),dmDrawWithTransparency);
61       SetVertLine(0,0,Height,BGRA(160,175,195,255));
62       SetVertLine(1,0,Height,BGRA(205,218,234,255));
63     end;
64     alBottom : with ABitmap do begin
65       Rectangle(0,2,Width,Height,BGRA(255,255,255,100),dmDrawWithTransparency);
66       SetHorizLine(0,0,Width-1,BGRA(160,175,195,255));
67       SetHorizLine(0,1,Width-1,BGRA(205,218,234,255));
68     end;
69     alClient, alCustom, alNone : with ABitmap do begin
70       Rectangle(0,0,Width,Height,BGRA(255,255,255,100),dmDrawWithTransparency);
71     end;
72   end;
73 end;
74 
75 end.
76 
77