Einzelnen Beitrag anzeigen

naschkatze1987

Registriert seit: 19. Sep 2006
Ort: Jacobsdorf
35 Beiträge
 
#21

Re: ich brauch dringende Hilfe bei meiner Analog Uhr!!!!!

  Alt 31. Mär 2007, 15:07
Das ist mein Quelltext:

Delphi-Quellcode:

procedure TForm1.BitBtn2Click(Sender: TObject);
begin
 close
end;

procedure TForm1.BitBtn1Click(Sender: TObject);
var i, k : integer;
begin
 Bitbtn1.visible:=false;
 k:=0;
 Timer1.Enabled:=true;

with Image1.canvas do
 BEGIN
   brush.color:=clblack;
   Rectangle(0,485,825,600);

//Himmel
  For i:=0 to 485 do
    Begin
      Pen.Color:=$00C293F0;
      MoveTo(0,i);
      LineTo(825,i);
    End;


 Repeat
  Pixels[random(clientwidth),random(100)]:=$00CA7ABB;
  inc(k)
 Until k=100000;

  k:=0;

 Repeat
  Pixels[random(clientwidth),random(200)]:=$00CA7ABB;
  inc(k)
 Until k=100000;

  k:=0;

 Repeat
  Pixels[random(clientwidth),random(300)]:=$00CA7ABB;
  inc(k)
 Until k=100000;

  k:=0;

 Repeat
  Pixels[random(clientwidth),random(400)]:=$00CA7ABB;
  inc(k)
 Until k=100000;

  k:=0;

 Repeat
  Pixels[random(clientwidth),random(486)]:=$00CA7ABB;
  inc(k)
 Until k=100000;

  k:=0;

 Repeat
  Pixels[random(clientwidth),random(100)]:=$00C46B97;
  inc(k)
 Until k=20000;

  k:=0;

 Repeat
  Pixels[random(clientwidth),random(200)]:=$00C46B97;
  inc(k)
 Until k=40000;

  k:=0;

 Repeat
  Pixels[random(clientwidth),random(300)]:=$00C46B97;
  inc(k)
 Until k=50000;

  k:=0;

 Repeat
  Pixels[random(clientwidth),random(400)]:=$00C46B97;
  inc(k)
 Until k=60000;

  k:=0;

 Repeat
  Pixels[random(clientwidth),random(486)]:=$00C46B97;
  inc(k)
 Until k=80000;


// Big Ben
 Pen.Color:=clblack;
 Brush.Color:=clblack;
 Polygon([Point(655,16),Point(622,110),Point(682,110)]);

 Pen.Color:=$0038383838;
 Brush.Color:=$0038383838;
 Rectangle(619,111,677,119);

 Pen.Color:=clblack;
 Brush.Color:=clblack;
 Polygon([Point(617,118),Point(677,118),Point(677,111),Point(680,105),Point(690,118),Point(690,166),Point(681,166),Point(681,127),Point(617,127)]);

 Pen.Color:=$0038383838;
 Brush.Color:=$0038383838;
 Rectangle(619,128,681,167);

 Pen.Color:=clblack;
 Brush.Color:=clblack;
 Polygon([Point(614,166),Point(691,167),Point(716,219),Point(590,219)]);

 Pen.Color:=$0038383838;
 Brush.Color:=$0038383838;
 Rectangle(587,220,702,228);

 Pen.Color:=clblack;
 Brush.Color:=clblack;
 Polygon([Point(578,227),Point(702,227),Point(702,220),Point(716,220),Point(716,233),Point(727,233),Point(728,267),Point(737,272),Point(737,412),Point(734,412),Point(730,417),Point(730,417),Point(730,600),Point(706,600),Point(706,400),Point(712,396),Point(712,239),Point(578,239)]);

 Pen.Color:=$0038383838;
 Brush.Color:=$0038383838;
 Polygon([Point(579,240),Point(711,240),Point(711,396),Point(705,401),Point(705,580),Point(570,580),Point(570,400),Point(567,400),Point(567,264),Point(570,264),Point(570,258),Point(579,255)]);

 Pen.Color:=clgray;
 Brush.Color:=clgray;
 Rectangle(571,268,709,395);
 Pen.Color:=clsilver;
 Brush.Color:=clsilver;
 Ellipse(575,272,703,390);

 END;

end;



procedure TForm1.Timer1Timer(Sender: TObject);
var winkel : real;
    x, y, x1, y1, r, i : Integer;
    hour, min, sec, msec : Word;
begin
 Form1.Caption:=DateTimeToStr(Now);

 Refresh;

 DecodeTime(Now, hour, min, sec, msec);

 r:=60;

// Ziffern
Canvas.Font.Size:=2;
Canvas.Textout(665,283,'I');
Canvas.Textout(680,300,'II');
Canvas.Textout(685,325,'III');
Canvas.Textout(679,351,'IV');
Canvas.Textout(663,368,'V');
Canvas.Textout(635,375,'VI');
Canvas.Textout(606,368,'VII');
Canvas.Textout(590,351,'VIII');
Canvas.Textout(584,325,'IX');
Canvas.Textout(593,300,'X');
Canvas.Textout(610,282,'XI');
Canvas.Textout(635,275,'XII');


// Sekundenzeiger
 winkel:=sec* ((2*pi) / 60) - pi/2;

 x:=Trunc(cos(winkel)*r);
 y:=Trunc(sin(winkel)*r);

 x:=x+(639);
 y:=y+(331);

 Canvas.Pen.Color:=clblack;
 Canvas.Pen.Width:=1;
 Canvas.MoveTo(639,331);
 Canvas.LineTo(x,y);

//Minutenzeiger
 winkel:=min* ((2*pi) / 60) - pi/2;

 x:=Trunc(cos(winkel)*r*0.9);
 y:=Trunc(sin(winkel)*r*0.9);

 x:=x+(639);
 y:=y+(331);

 Canvas.Pen.Width:=2;
 Canvas.MoveTo(639,331);
 Canvas.LineTo(x,y);

//Stundenzeiger
 IF hour>12 THEN hour:=hour-12;
 winkel:=(hour*(2*pi) / 12) + (min*(2*pi) / 720) - pi/2;

 x:=Trunc(cos(winkel)*r*0.6);
 y:=Trunc(sin(winkel)*r*0.6);

 x:=x+(639);
 y:=y+(331);

 Canvas.Pen.Width:=3;
 Canvas.MoveTo(639,331);
 Canvas.LineTo(x,y);

// Ziffernstriche
FOR i:=0 TO 11 DO
begin
 winkel:=i*((2*pi) / 12) - pi/2;

 x:=Trunc(cos(winkel)*r*1.2);
 y:=Trunc(sin(winkel)*r*1.2);
 x1:=Trunc(cos(winkel)*r);
 y1:=Trunc(sin(winkel)*r);

 x:=x+(639);
 y:=y+(331);
 x1:=x1+(639);
 y1:=y1+(331);

 Canvas.Pen.Width:=2;
 Canvas.MoveTo(x,y);
 Canvas.LineTo(x1,y1);
end;

 // Minutenstriche
FOR i:=0 TO 59 DO
begin
 winkel:=i*((2*pi) / 60) - pi/2;

 x:=Trunc(cos(winkel)*r*1.1);
 y:=Trunc(sin(winkel)*r*1.1);
 x1:=Trunc(cos(winkel)*r);
 y1:=Trunc(sin(winkel)*r);

 x:=x+(639);
 y:=y+(331);
 x1:=x1+(639);
 y1:=y1+(331);

 Canvas.Pen.Width:=1;
 Canvas.MoveTo(x,y);
 Canvas.LineTo(x1,y1);
end;

end;

procedure TForm1.FormCreate(Sender: TObject);
begin
 Timer1.Enabled:=false;
end;
und die neue Datei hab ich angehangen...
Angehängte Dateien
Dateityp: zip uhr_160.zip (176,0 KB, 12x aufgerufen)
naschkatze1987
*miau*
  Mit Zitat antworten Zitat