hi leute...
vor jahren habe ich mit dem c++ builder mal nen kleinen tool gebastelt...
nun steh ich vor dem problem, dass ich nicht weiß, wie ich das entsprechend in delphi umwandeln kann...
ich hoffe, es findet sich jemand, der das kann...
hier der quelltext:
ich danke schon jetzt für jegliche hilfe ;-)
mfg
ice
vor jahren habe ich mit dem c++ builder mal nen kleinen tool gebastelt...
nun steh ich vor dem problem, dass ich nicht weiß, wie ich das entsprechend in delphi umwandeln kann...
ich hoffe, es findet sich jemand, der das kann...
hier der quelltext:
Code:
//--------------------------------------------------------------------------- #include <vcl.h> #pragma hdrstop #include "Unit1.h" //--------------------------------------------------------------------------- #pragma package(smart_init) #pragma resource "*.dfm" TForm1 *Form1; TPoint p1,p2,dp1,dp2,bs; //--------------------------------------------------------------------------- __fastcall TForm1::TForm1(TComponent* Owner): TForm(Owner) { BorderStyle=bsNone; Position=poScreenCenter; p1.x=10; p1.y=100; p2.x=100; p2.y=10; dp1.x=5; dp1.y=10; dp2.x=10; dp2.y=5; bs.x=ClientWidth; bs.y=ClientHeight; } //--------------------------------------------------------------------------- void __fastcall TForm1::Timer1Timer(TObject *Sender) { Canvas->Pen->Color=RGB(rand()%255,rand()%255,rand()%255); Canvas->MoveTo(p1.x,p1.y); Canvas->LineTo(p2.x,p2.y); p1.x+=dp1.x; p1.y+=dp1.y; p2.x+=dp2.x; p2.y+=dp2.y; if(p1.x>bs.x || p1.x<10) { p2.x-=dp2.x; p2.y-=dp2.y; dp1.x=-dp1.x; } if(p1.y>bs.y || p1.y<10) { p2.x-=dp2.x; p2.y-=dp2.y; dp1.y=-dp1.y; } if(p2.x>bs.x || p2.x<10) { p1.x-=dp1.x; p1.y-=dp1.y; dp2.x=-dp2.x; } if(p2.y>bs.y || p2.y<10) { p1.x-=dp1.x; p1.y-=dp1.y; dp2.y=-dp2.y; } } //--------------------------------------------------------------------------- void __fastcall TForm1::FormKeyDown(TObject *Sender, WORD &Key, TShiftState Shift) { if(Key==VK_ESCAPE) Close(); } //---------------------------------------------------------------------------
mfg
ice
Comment