Rabu, 04 April 2012

GRAFIKA KOMPUTER

untuk memenuhi tugas pratikum grafkom yaitu membuat bujur sangkar

maka saya mencoba coba dengan hasil seperti berikut

dan listing programnya sebagai berikut
procedure TForm1.Button1Click(Sender: TObject);
var
  x,y,i,j : Integer;
begin
  if (edit1.text)<>''then
  x:=StrToInt(edit1.Text);
  if (edit2.text)<>''then
  y:=StrToInt(edit2.Text);
  for i:=x to x+100 do
  for j:=y to y+100 do
  //image1.Canvas.Pixels[i,j]:=clblue;
  Image1.Canvas.Pen.Color:=clRed;
  Image1.Canvas.Brush.Color:= clyellow;
  image1.Canvas.Rectangle(10,10,100,100);

end;

end.

dan hasilnya sebagai berikut

0 komentar:

Posting Komentar

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Hostgator Discount Code