




Membuat suatu bentuk dalam Grafika Komputer pentuk gerak atau bentuk apapun baik 3D Game dan lai-lain....
ini contoh membuat gambar bergerak Mata Berkedip...
Instal Program dan Tilis Perintah untuk membuat gambar atau garis yang dibutuhkan untuk memnggambar dan meng gerakan matanya agar berkedip.... sebagai berikut...
unit MATA;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, jpeg;
type
TForm1 = class(TForm)
Image1: TImage;
Timer1: TTimer;
Button1: TButton;
Panel1: TPanel;
Timer2: TTimer;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
// procedure FormCreate(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure FormActivate(Sender: TObject);
// procedure Label1Click(Sender: TObject);
procedure Timer2Timer(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
gambar : Integer;
implementation
{$R *.dfm}
procedure TForm1.Timer1Timer(Sender: TObject);
begin
if gambar=1 then
image1.Picture.LoadFromFile('C:\Mata\mata1.bmp')
else if gambar=2 then
image1.Picture.LoadFromFile('C:\Mata\mata2.bmp')
else if gambar=3 then
Image1.Picture.LoadFromFile('C:\Mata\mata3.bmp')
else if gambar=4 then
Image1.Picture.LoadFromFile('C:\Mata\mata4.bmp')
else
Image1.Picture.LoadFromFile('C:\Mata\mata5.bmp');
if gambar=5 then
gambar:=1
else
inc(gambar);
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
if Button1.Caption='Stop' then
begin
timer1.Enabled:=False;
Button1.Caption:='Start';
end else
begin
timer1.Enabled:=true;
Button1.Caption:='Stop';
end;
Timer2.Enabled := true
end;
procedure TForm1.FormActivate(Sender: TObject);
begin
gambar:=1;
end;
procedure TForm1.Timer2Timer(Sender: TObject);
begin
Label1.Left := Label1.Left - 5;
if Label1.Left < -110 then Label1.Left := 400; end; end. Dengan Nama -Nama Kelompok sebagai berikut:
- Arief Wijaya (080403020048)
- Bagus Bayu W (080403020050)
- Dicky arieska H (080403020045)
- Millatina S (080403020006)
- Zainul Abidin (080403020095)
Tidak ada komentar:
Posting Komentar