Coba-coba menggambar pakai Delphi + Coding-nya

9 12 2012

delphiLucu kan??? Mau tau gimana bikinnya??

Dengan delphi kita bisa membuat kalkulator dan program-program matematika khususnya (yang banyak kami pelajari), tapi kali ini kita tidak akan membuat program matematika melainkan membuat gambar (tentunya masih dengan perhitungan matematikanya) pada delphi ini. Mungkin lain kali akan di post program matematikanya yah.. hehee

################################################################

procedure TForm1.Button1Click(Sender: TObject);

begin

  with Image1.canvas do

  begin

  Polygon([Point(0,0),Point(472,0),Point(472,272),Point(0,272)]);

  Brush.Color:=clSilver;

  Polygon([Point(30,30),Point(442,30),Point(442,272),Point(30,272)]);

  end;

  with Image1.canvas do

  begin

  Brush.Color:=clSkyBlue;

  Ellipse(110,35,345,600);

  end;

  with Image1.canvas do

  begin

  Brush.Color:=clCream;

  Ellipse(175,70,278,193);

  end;

  with Image1.canvas do

  begin

  Ellipse(195,103,215,128);

  Ellipse(238,103,258,128);

  end;

  with Image1.canvas do

  begin

  Arc(195,100,215,105,215,105,195,100);

  Arc(238,100,258,105,258,105,238,100);

  Arc(175,85,278,130,268,105,165,105);

  moveto(227,128);

  LineTo(239,142);

  LineTo(227,146);

  end;

  with Image1.canvas do

  begin

  Arc(222,86,463,250,222,193,300,245);

  end;

  with Image1.canvas do

  begin

  Brush.Color:=clHotLight;

  Ellipse(300,235,330,265);

  end;

  with Image1.canvas do

  begin

  Brush.Color:=clBlack;

  Ellipse(203,110,215,123);

  Brush.Color:=clBlack;

  Ellipse(238,110,250,123);

  end;

  with Image1.canvas do

  begin

  Arc(205,139,248,177,205,158,248,158);

  MoveTo(205,158);

  LineTo(248,158);

  end;

end;

procedure TForm1.Button2Click(Sender: TObject);

begin

close;

end;

end.

################################################################

Tanda pagar di atas hanya sebagai pembatas saja, tidak termasuk bagian dari Coding

Rada ribet yah? hmm, namanya juga masih belajar, hehee

ayo teman-temaan, selamat mencobaaa..
😀


Aksi

Information

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s




%d blogger menyukai ini: