INGIN punya hasil programnya seperti terlihat pada gambar,,
Pelajarilah logika dari setiap langkah ....
Nah... sediakan 5 tombol masing2 ganti nama tombolnya yaaaa...
Berikut sintaks yang digunakan....
SELAMAT MENCOBA...
procedure TForm1.GARISClick(Sender: TObject);
var i,j,x,y : integer;
begin
x :=clientwidth;
y := clientheight;
for i:= 1 to x do
begin
canvas.Pixels[i,y div 8]:= clred;
canvas.Pixels[i,y div 8*2]:=clred;
canvas.Pixels[i,y div 8*6]:=clred;
canvas.Pixels[i,y div 8*7]:=clred;
end;
begin
canvas.pen.Width := 1;
canvas.Pen.Color :=clred;
canvas.MoveTo(340,0);
canvas.LineTo(340,110);
end;
begin
canvas.pen.Width := 1;
canvas.Pen.Color :=clred;
canvas.MoveTo(450,0);
canvas.LineTo(450,110);
end;
begin
canvas.pen.Width := 1;
canvas.Pen.Color :=clred;
canvas.MoveTo(560,0);
canvas.LineTo(560,110);
end;
begin
canvas.pen.Width := 1;
canvas.Pen.Color :=clred;
canvas.MoveTo(0,165);
canvas.LineTo(230,165);
end;
begin
canvas.pen.Width := 1;
canvas.Pen.Color :=clred;
canvas.MoveTo(0,220);
canvas.LineTo(230,220);
end;
begin
canvas.pen.Width := 1;
canvas.Pen.Color :=clred;
canvas.MoveTo(0,275);
canvas.LineTo(230,275);
end;
begin
canvas.pen.Width := 1;
canvas.Pen.Color :=clred;
canvas.MoveTo(340,330);
canvas.LineTo(340,440);
end;
begin
canvas.pen.Width := 1;
canvas.Pen.Color :=clred;
canvas.MoveTo(450,330);
canvas.LineTo(450,440);
end;
begin
canvas.pen.Width := 1;
canvas.Pen.Color :=clred;
canvas.MoveTo(560,330);
canvas.LineTo(560,440);
end;
begin
canvas.pen.Width := 1;
canvas.Pen.Color :=clred;
canvas.MoveTo(685,165);
canvas.LineTo(920,165);
end;
begin
canvas.pen.Width := 1;
canvas.Pen.Color :=clred;
canvas.MoveTo(685,220);
canvas.LineTo(920,220);
end;
begin
canvas.pen.Width := 1;
canvas.Pen.Color :=clred;
canvas.MoveTo(685,275);
canvas.LineTo(920,275);
end;
for i:= 1 to y do
begin
canvas.Pixels[x div 8,i]:=clred;
canvas.Pixels[x div 8*2,i]:=clred;
canvas.Pixels[x div 8*6,i]:=clred;
canvas.Pixels[x div 8*7,i]:=clred;
end;
end;
procedure TForm1.NAMAClick(Sender: TObject);
var x,y :integer;
begin
x:=250;
y:=120;
begin
canvas.Pen.Width:=5;
canvas.Pen.Color:=clblack;
//huruf A
canvas.MoveTo (20+x,40+y);
canvas.LineTo (20+x,10+y);
canvas.LineTo (40+x,10+y);
canvas.LineTo (40+x,40+y);
canvas.MoveTo (20+x,25+y);
canvas.LineTo (40+x,25+y);
//huruf N
canvas.MoveTo (50+x,40+y);
canvas.LineTo (50+x,10+y);
canvas.LineTo (70+x,40+y);
canvas.LineTo (70+x,10+y);
//huruf I
canvas.MoveTo (80+x,10+y);
canvas.LineTo (80+x,40+y);
//huruf E
canvas.MoveTo (110+x,10+y);
canvas.LineTo (90+x,10+y);
canvas.LineTo (90+x,40+y);
canvas.LineTo (110+x,40+y);
canvas.MoveTo (90+x,25+y);
canvas.LineTo (110+x,25+y);
//huruf C
canvas.MoveTo(160+x,200+y);
canvas.LineTo(140+x,200+y);
canvas.LineTo(140+x,170+y);
canvas.LineTo(160+x,170+y);
//huruf I
canvas.MoveTo(170+x,170+y);
canvas.LineTo(170+x,200+y);
//huruf I
canvas.MoveTo(180+x,170+y);
canvas.LineTo(180+x,200+y);
//huruf M
canvas.MoveTo(190+x,200+y);
canvas.LineTo(190+x,170+y);
canvas.LineTo(205+x,200+y);
canvas.LineTo(220+x,170+y);
canvas.LineTo(220+x,200+y);
//huruf I
canvas.MoveTo(230+x,200+y);
canvas.LineTo(230+x,170+y);
//huruf C
canvas.MoveTo(260+x,170+y);
canvas.LineTo(240+x,170+y);
canvas.LineTo(240+x,200+y);
canvas.LineTo(260+x,200+y);
//huruf K
canvas.MoveTo(270+x,170+y);
canvas.LineTo(270+x,200+y);
canvas.LineTo(270+x,185+y);
canvas.LineTo(290+x,170+y);
canvas.MoveTo(270+x,185+y);
canvas.LineTo(290+x,200+y);
//huruf E
canvas.MoveTo(320+x,170+y);
canvas.LineTo(300+x,170+y);
canvas.LineTo(300+x,200+y);
canvas.LineTo(320+x,200+y);
canvas.MoveTo(300+x,185+y);
canvas.LineTo(320+x,185+y);
//huruf Y
canvas.MoveTo(330+x,170+y);
canvas.LineTo(340+x,185+y);
canvas.LineTo(340+x,200+y);
canvas.MoveTo(340+x,185+y);
canvas.LineTo(350+x,170+y);
end;
end;
procedure TForm1.POLYGONClick(Sender: TObject);
var i,j,x,y :integer;
begin
x := 115;
y := 56;
canvas.Pen.Width := 2;
canvas.Pen.Color := clgray;
canvas.Brush.Color := clmaroon;
for i := 0 to 7 do
begin
for j := 0 to 1 do
begin
canvas.Polygon([point(30+(x*i),20+(y*j)),
point(60+(x*i),0+(y*j)),
point(90+(x*i),20+(y*j)) ,
point(80+(x*i),50+(y*j)),
point(40+(x*i),50+(y*j)),
point (30+(x*i),20+(y*j))]);
end;
for j := 6 to 7 do
begin
canvas.Polygon([point(30+(x*i),15+(y*j)),
point(60+(x*i),0+(y*j)),
point(90+(x*i),15+(y*j)) ,
point(80+(x*i),45+(y*j)),
point(40+(x*i),45+(y*j)),
point (30+(x*i),15+(y*j))]);
end;
end;
end;
procedure TForm1.SEPEDAClick(Sender: TObject);
begin
canvas.Brush.Color:=clgray;
canvas.Pen.Width:=3;
canvas.Ellipse(300,200,400,300);
canvas.Brush.Color:=clcream;
canvas.Ellipse(310,210,390,290);
canvas.Brush.Color:=clolive;
canvas.Ellipse(340,240,360,260);
canvas.Brush.Color:=clolive;
canvas.Ellipse(430,230,470,270);
canvas.Brush.Color:=clgray;
canvas.Pen.Width:=3;
canvas.Ellipse(580,200,680,300);
canvas.Brush.Color:=clcream;
canvas.Ellipse(590,210,670,290);
canvas.Brush.Color:=clolive;
canvas.Ellipse(620,240,640,260);
canvas.Pen.Color:=clmaroon;
canvas.Polyline([point (350,250),point (450,170)]);
canvas.Polyline([point (350,250),point (430,250)]);
canvas.Polyline([point (450,230),point (450,150)]);
canvas.Pen.Width:=8;
canvas.Polygon([point(430,150),point(470,150)]);
canvas.Polygon([point(430,130),point(470,140)]);
canvas.Arc(420,130,440,150,430,130,430,150);
canvas.Arc(460,140,480,150,470,150,470,140);
canvas.Pen.Width:=5;
canvas.Polyline([point (470,250),point (600,170)]);
canvas.Pen.Width:=5;
canvas.Polyline([point (600,170),point (450,190)]);
canvas.Pen.Width:=5;
canvas.Polyline([point (630,250),point (600,170)]);
canvas.Pen.Width:=5;
canvas.Polyline([point (600,170),point (600,140)]);
canvas.Pen.Width:=5;
canvas.Polygon([point (580,120),point (620,150)]);
canvas.Pen.Color:=clblack;
canvas.Pen.Width:=1;
canvas.Polyline([point (350,240),point (440,230)]);
canvas.Pen.Color:=clblack;
canvas.Pen.Width:=1;
canvas.Polyline([point (350,260),point (440,270)]);
canvas.Pen.Color:=clblack;
canvas.Pen.Width:=5;
canvas.Polyline([point (450,250),point (420,280)]);
canvas.Pen.Color:=clblack;
canvas.Pen.Width:=5;
canvas.Polyline([point (415,280),point (425,280)]);
canvas.Pen.Color:=clblack;
canvas.Pen.Width:=5;
canvas.Polyline([point (480,215),point (465,230)]);
canvas.Pen.Color:=clblack;
canvas.Polyline([point (470,215),point (485,215)]);
end;
procedure TForm1.POLYLINEClick(Sender: TObject);
var i,j,x,y :integer;
begin
x := 115;
y := 56;
canvas.Pen.Width := 2;
canvas.Pen.Color := clmaroon;
canvas.Brush.Color := clgray;
for i := 0 to 1 do
begin
for j := 0 to 3 do
begin
canvas.Polygon([point(30+(x*i),130+(y*j)),
point (50+(x*i),130+(y*j)),
point (60+(x*i),110+(y*j)),
point(70+(x*i),130+(y*j)),
point (90+(x*i),130+(y*j)),
point(70+(x*i),140+(y*j)),
point(80+(x*i),160+(y*j)),
point(60+(x*i),150+(y*j)),
point(40+(x*i),160+(y*j)),
point(50+(x*i),140+(y*j))]);
end;
for j := 0 to 3 do
begin
canvas.Polygon([point(720+(x*i),130+(y*j)),
point (740+(x*i),130+(y*j)),
point (750+(x*i),110+(y*j)),
point(760+(x*i),130+(y*j)),
point (780+(x*i),130+(y*j)),
point(760+(x*i),140+(y*j)),
point(770+(x*i),160+(y*j)),
point(750+(x*i),150+(y*j)),
point(730+(x*i),160+(y*j)),
point(740+(x*i),140+(y*j))]);
end;
end;
end;
end.
SEMOGA BERHASIL... :)