Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
49
Task/Colour-bars-Display/Delphi/colour-bars-display-1.delphi
Normal file
49
Task/Colour-bars-Display/Delphi/colour-bars-display-1.delphi
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
unit Colour_barsDisplay;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Winapi.Windows, System.SysUtils, System.Classes, Vcl.Graphics, Vcl.Forms;
|
||||
|
||||
type
|
||||
TfmColourBar = class(TForm)
|
||||
procedure FormPaint(Sender: TObject);
|
||||
procedure FormResize(Sender: TObject);
|
||||
private
|
||||
{ Private declarations }
|
||||
public
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
fmColourBar: TfmColourBar;
|
||||
Colors: array of TColor = [clblack, clred, clgreen, clblue, clFuchsia, clAqua,
|
||||
clyellow, clwhite];
|
||||
|
||||
implementation
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
procedure TfmColourBar.FormPaint(Sender: TObject);
|
||||
var
|
||||
w, h, i: Integer;
|
||||
r: TRect;
|
||||
begin
|
||||
w := ClientWidth div length(Colors);
|
||||
h := ClientHeight;
|
||||
r := Rect(0, 0, w, h);
|
||||
|
||||
with Canvas do
|
||||
for i := 0 to High(Colors) do
|
||||
begin
|
||||
Brush.Color := Colors[i];
|
||||
FillRect(r);
|
||||
r.Offset(w, 0);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfmColourBar.FormResize(Sender: TObject);
|
||||
begin
|
||||
Invalidate;
|
||||
end;
|
||||
end.
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
object fmColourBar: TfmColourBar
|
||||
Caption = 'fmColourBar'
|
||||
OldCreateOrder = False
|
||||
OnPaint = FormPaint
|
||||
OnResize = FormResize
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue