Tuesday, January 11, 2011

1

PROJECT ANIMASI (DELPHI 7)

Posted in
................ANIMASI (569,217).......................

procedure Tunda(Detik,MiliDetik:word);
var
  TimeOut: TDateTime;
begin
  TimeOut:=Now+EncodeTime(0,Detik div 60, Detik mod 60, MiliDetik);
  while Now<TimeOut do
    Application.ProcessMessages;
    end;

procedure TForm1.Button1Click(Sender: TObject);
var i:integer;
begin

   with Image1.Canvas do
   begin
   Pen.Width:=3;
   Brush.Color:=clbtnface;
   Pen.Color:=clbtnface;
   Rectangle(0,0,569,217); //layar
   end;

   with Image1.Canvas do
   begin
   Pen.Width:=3;
   Pen.Color:=clblack;
   RoundRect(120,8,430,22,7,7);  //AC
   RoundRect(58,22,504,180,20,20); //body bus
   Rectangle(180,135,351,180)  //bagasi
   end;

   with Image1.Canvas do
   begin
   Brush.Color:=claqua;
   Rectangle(58,95,504,99); //hiasan warna
   Brush.Color:=cllime;
   Rectangle(151,116,504,126); //hiasan warna
   Brush.Color:=clyellow;
   Rectangle(292,168,504,173); //hiasan warna

   Brush.Color:=clred;
   Rectangle(208,142,504,158); //hiasan warna
   end;

   with Image1.Canvas do
   begin
   Brush.Color:=clgray;
   Ellipse(107,162,153,208); //ban hareup
   Ellipse(381,162,428,208); //ban tukang
   Brush.Color:=clsilver;
   Ellipse(121,174,141,195); //pelk
   Ellipse(395,174,416,195); //pelk
   end;


   with Image1.Canvas do
   begin
   Brush.Color:=clblue;
   RoundRect(473,8,502,18,10,10);  //racing na tah
   end;
       //animasi mengecat
      with Image1.Canvas do
      begin
      Brush.Color:=clwhite;
      RoundRect(58,22,504,180,20,20); //body bus
      Pen.Color:=clblue;
      for i:=1 to 440 do
      begin
      MoveTo(61,25);
      LineTo(61,177);
      MoveTo(61+i,25);
      LineTo(61+i,177);
      Tunda(0,10);
      end;
      end;

   //animasi AC
   with Image1.Canvas do
   begin
   Pen.Width:=3;
   Pen.Color:=clblack;
   RoundRect(120,8,430,22,7,7);  //AC
   Pen.Color:=clmedgray;
      for i:=1 to 303 do
      begin
      MoveTo(123,11);
      LineTo(123,19);
      MoveTo(123+i,11);
      LineTo(123+i,19);
      Tunda(0,10);
      end;
      end;

   with Image1.Canvas do
   begin
   Pen.Color:=clblack;
   RoundRect(58,40,71,95,20,2);     //kaca
   RoundRect(156,40,208,95,20,20);  //kaca
   RoundRect(217,40,269,95,20,20);  //kaca
   RoundRect(280,40,332,95,20,20);  //kaca
   RoundRect(341,40,393,95,20,20);  //kaca
   RoundRect(479,40,504,95,2,20);  //kaca
   Brush.Color:=clblue;
   Rectangle(180,135,351,180); //bagasi
   end;
  
   with Image1.Canvas do
   begin
   Pen.Width:=3;
   Pen.Color:=clblack;
   Brush.Color:=clblue;
   Rectangle(79,29,151,158); //pintu depan
   Rectangle(395,29,467,158); //pintu belakang
   Brush.Color:=clwhite;
   Rectangle(89,34,144,95);    //kaca panto
   Rectangle(405,34,460,95);    //kaca panto
   end;

     //animasi hiasan warna aqua
  with Image1.Canvas do
   begin
   Pen.Width:=1;
   Brush.Color:=clwhite;
   Rectangle(58,95,504,99); //hiasan warna
   Pen.Color:=claqua;
   for i:=1 to 443 do
      begin
      MoveTo(59,96);
      LineTo(59,98);
      MoveTo(59+i,96);
      LineTo(59+i,98);
      Tunda(0,10);
      end;
      end;

      //animasi hiasan warna ijo
  with Image1.Canvas do
   begin
   Pen.Width:=1;
   Brush.Color:=clwhite;
   Rectangle(151,116,504,126); //hiasan warna
   Pen.Color:=cllime;
   for i:=1 to 353 do
      begin
      MoveTo(152,117);
      LineTo(152,125);
      MoveTo(152+i,117);
      LineTo(152+i,125);
      Tunda(0,10);
      end;
      end;

       //animasi hiasan warna merah
  with Image1.Canvas do
   begin
   Pen.Width:=1;
   Brush.Color:=clwhite;
   Rectangle(208,142,504,158); //hiasan warna
   Pen.Color:=clred;
   for i:=1 to 295 do
      begin
      MoveTo(209,143);
      LineTo(209,157);
      MoveTo(209+i,143);
      LineTo(209+i,157);
      Tunda(0,10);
      end;
      end;

      //animasi hiasan warna kuning
  with Image1.Canvas do
   begin
   Pen.Width:=1;
   Brush.Color:=clwhite;
   Rectangle(292,168,504,173); //hiasan warna
   Pen.Color:=clyellow;
   for i:=1 to 213 do
      begin
      MoveTo(291,169);
      LineTo(291,172);
      MoveTo(291+i,169);
      LineTo(291+i,172);
      Tunda(0,10);
      end;
      end;


    with Image1.Canvas do
   begin
   Pen.Width:=3;
   Pen.Color:=clblack;
   Brush.Color:=clgray;
   Ellipse(107,162,153,208); //ban hareup
   Ellipse(381,162,428,208); //ban tukang
   Brush.Color:=clsilver;
   Ellipse(121,174,141,195); //pelk
   Ellipse(395,174,416,195); //pelk
   Brush.Color:=clbackground;
   Ellipse(136,109,148,120); //gagang panto
   Ellipse(452,109,464,120); //gagang panto belakang
   Pen.Color:=clblack;
   Brush.Color:=clblack;
   Rectangle(453,180,460,193);    //knalpot
   RoundRect(453,188,481,199,2,20);  //knalpot
   end;

  
 //kata-kata
  with Image1.Canvas do
   begin
    Brush.Style:=bsClear;
    Brush.Color:=clblue;
    Font.Color:=clmaroon;
    Font.Name:='Arial';
    Font.Style:=[fsbold];
    Font.Size:=20;
    TextOut(170,102,'DOELF_PRODUCT');
   end;
   end;
procedure TForm1.Button2Click(Sender: TObject);
begin
  close;
end;

end.

1 comment: