Ini merupakan suatu program sederhana untuk membuat obyek atau grafik, disini contoh sebuah obyek sebuah pintu yang belum 3 dimensi, tapi yaaaa...... lumayan buat latihan mah, silahkan download aza source codenya dibawah ini :
unit tugas;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
canvas.MoveTo(88,50);
canvas.LineTo(88,360);
canvas.MoveTo(88,50);
canvas.LineTo(300,50);
canvas.MoveTo(300,50);
canvas.LineTo(300,360);
canvas.MoveTo(88,360);
canvas.LineTo(300,360);
canvas.Pen.Color := clgreen;
canvas.MoveTo(78,40);
canvas.LineTo(78,370);
canvas.MoveTo(78,40);
canvas.LineTo(310,40);
canvas.MoveTo(310,40);
canvas.LineTo(310,370);
canvas.MoveTo(78,370);
canvas.LineTo(310,370);
canvas.Pen.Color := clgreen;
canvas.MoveTo(98,58);
canvas.LineTo(98,200);
canvas.MoveTo(98,58);
canvas.LineTo(185,58);
canvas.MoveTo(185,58);
canvas.LineTo(185,200);
canvas.MoveTo(98,200);
canvas.LineTo(185,200);
canvas.Pen.Color := clgreen;
canvas.MoveTo(205,58);
canvas.LineTo(205,200);
canvas.MoveTo(205,58);
canvas.LineTo(290,58);
canvas.MoveTo(290,58);
canvas.LineTo(290,200);
canvas.MoveTo(205,200);
canvas.LineTo(290,200);
canvas.Pen.Color := clgreen;
canvas.MoveTo(250,205);
canvas.LineTo(250,210);
canvas.MoveTo(250,205);
canvas.LineTo(290,205);
canvas.Pen.Color := clgreen;
canvas.MoveTo(290,205);
canvas.LineTo(290,210);
canvas.MoveTo(250,210);
canvas.LineTo(290,210);
canvas.MoveTo(98,352);
canvas.LineTo(98,220);
canvas.MoveTo(98,352);
canvas.LineTo(185,352);
canvas.MoveTo(185,352);
canvas.LineTo(185,220);
canvas.MoveTo(98,220);
canvas.LineTo(185,220);
canvas.Pen.Color := clgreen;
canvas.MoveTo(205,352);
canvas.LineTo(205,220);
canvas.MoveTo(205,352);
canvas.LineTo(290,352);
canvas.MoveTo(290,352);
canvas.LineTo(290,220);
canvas.MoveTo(205,220);
canvas.LineTo(290,220);
canvas.Pen.Color := clgreen;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
canvas.MoveTo(78,40);
canvas.LineTo(88,50);
canvas.MoveTo(310,40);
canvas.LineTo(300,50);
canvas.MoveTo(300,360);
canvas.LineTo(310,370);
canvas.MoveTo(78,370);
canvas.LineTo(88,360);
end;
end.
Copyright By Dikdik Permadi
Senin, 02 Maret 2009
Komputer Grafik
Posted by Dikdik Permadi on 03.54
0 komentar:
Posting Komentar