![]() |
|
論壇說明 |
歡迎您來到『史萊姆論壇』 ^___^ 您目前正以訪客的身份瀏覽本論壇,訪客所擁有的權限將受到限制,您可以瀏覽本論壇大部份的版區與文章,但您將無法參與任何討論或是使用私人訊息與其他會員交流。若您希望擁有完整的使用權限,請註冊成為我們的一份子,註冊的程序十分簡單、快速,而且最重要的是--註冊是完全免費的! 請點擊這裡:『註冊成為我們的一份子!』 |
|
主題工具 | 顯示模式 |
![]() |
#1 |
版區管理員
![]() |
![]() 這程式原本是設計成螢幕保護程式的
現在改成一般程式,大家若有興趣可自行修改(原來部分小王子只是remake而已) 語法:
//--------------------------------------------------------------------------- #include <vcl.h> #pragma hdrstop #include "Unit1.h" #include "math.h" #include "stdlib.h" //--------------------------------------------------------------------------- #pragma package(smart_init) #pragma resource "*.dfm" TForm1 *Form1; int GX=0,GY=0; int hr,min,sec; int hr1,min1,sec1; int x=Screen->Width/2; int y=Screen->Height/2+10; int r=Screen->Height/2-30; float j; /* Graphics::TBitmap* Bmp0=new Graphics::TBitmap; Graphics::TBitmap* Bmp1=new Graphics::TBitmap; Graphics::TBitmap* Bmp2=new Graphics::TBitmap; Graphics::TBitmap* Bmp3=new Graphics::TBitmap; Graphics::TBitmap* Bmp4=new Graphics::TBitmap; Graphics::TBitmap* Bmp5=new Graphics::TBitmap; Graphics::TBitmap* Bmp6=new Graphics::TBitmap; Graphics::TBitmap* Bmp7=new Graphics::TBitmap; Graphics::TBitmap* Bmp8=new Graphics::TBitmap; Graphics::TBitmap* Bmp9=new Graphics::TBitmap; Graphics::TBitmap* Bmpc=new Graphics::TBitmap; */ //--------------------------------------------------------------------------- __fastcall TForm1::TForm1(TComponent* Owner) : TForm(Owner) { } //--------------------------------------------------------------------------- void __fastcall TForm1::FormMouseMove(TObject *Sender, TShiftState Shift, int X, int Y) { /* if((GX==0)&&(GY==0)) {GX=X;GY=Y;} if((GX!=X)||(GY!=Y)) Close(); */ } //--------------------------------------------------------------------------- void __fastcall TForm1::FormKeyDown(TObject *Sender, WORD &Key, TShiftState Shift) { Close(); } //--------------------------------------------------------------------------- void __fastcall TForm1::FormMouseDown(TObject *Sender, TMouseButton Button, TShiftState Shift, int X, int Y) { Close(); } //--------------------------------------------------------------------------- void __fastcall TForm1::FormActivate(TObject *Sender) { /* Bmp0->Handle=LoadBitmap(HInstance,"bmp0"); Bmp1->Handle=LoadBitmap(HInstance,"bmp1"); Bmp2->Handle=LoadBitmap(HInstance,"bmp2"); Bmp3->Handle=LoadBitmap(HInstance,"bmp3"); Bmp4->Handle=LoadBitmap(HInstance,"bmp4"); Bmp5->Handle=LoadBitmap(HInstance,"bmp5"); Bmp6->Handle=LoadBitmap(HInstance,"bmp6"); Bmp7->Handle=LoadBitmap(HInstance,"bmp7"); Bmp8->Handle=LoadBitmap(HInstance,"bmp8"); Bmp9->Handle=LoadBitmap(HInstance,"bmp9"); Bmpc->Handle=LoadBitmap(HInstance,"bmpc"); */ } //--------------------------------------------------------------------------- void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action) { /* ShowCursor(true); delete Bmp0; delete Bmp1; delete Bmp2; delete Bmp3; delete Bmp4; delete Bmp5; delete Bmp6; delete Bmp7; delete Bmp8; delete Bmp9; delete Bmpc; */ } //--------------------------------------------------------------------------- void __fastcall TForm1::FormPaint(TObject *Sender) { /* String d=DateToStr(Date()); int y1=d.SubString(1,4).ToInt()-1911; Canvas->Draw(x-150,3,Day); DrawBmp(x-27,8,IntToStr(y1).SubString(1,1).ToInt()); DrawBmp(x-10,8,IntToStr(y1).SubString(2,1).ToInt()); if(d.SubString(7,1)!="\/"){ DrawBmp(x+33,8,1); DrawBmp(x+50,8,d.SubString(7,1).ToInt()); } else { DrawBmp(x+33,8,0); DrawBmp(x+50,8,d.SubString(6,1).ToInt()); } if(d.SubString(d.Length()-1,1)!="\/"){ DrawBmp(x+90,8,d.SubString(d.Length()-1,1).ToInt()); DrawBmp(x+107,8,d.SubString(d.Length(),1).ToInt()); } else { DrawBmp(x+90,8,0); DrawBmp(x+107,8,d.SubString(d.Length(),1).ToInt()); } */ Canvas->Pen->Color=clWhite; Canvas->Pen->Width=1; Canvas->Ellipse(x-r,y-r,x+r,y+r); j=-1.57+3.14*0/30; Canvas->Pen->Width=2; Canvas->MoveTo(x+cos(j)*(r-50),y+sin(j)*(r-50)); Canvas->LineTo(x+cos(j)*(r-10),y+sin(j)*(r-10)); j=-1.57+3.14*5/30; Canvas->Pen->Width=1; Canvas->MoveTo(x+cos(j)*(r-30),y+sin(j)*(r-30)); Canvas->LineTo(x+cos(j)*(r-10),y+sin(j)*(r-10)); j=-1.57+3.14*10/30; Canvas->Pen->Width=1; Canvas->MoveTo(x+cos(j)*(r-30),y+sin(j)*(r-30)); Canvas->LineTo(x+cos(j)*(r-10),y+sin(j)*(r-10)); j=-1.57+3.14*15/30; Canvas->Pen->Width=2; Canvas->MoveTo(x+cos(j)*(r-50),y+sin(j)*(r-50)); Canvas->LineTo(x+cos(j)*(r-10),y+sin(j)*(r-10)); j=-1.57+3.14*20/30; Canvas->Pen->Width=1; Canvas->MoveTo(x+cos(j)*(r-30),y+sin(j)*(r-30)); Canvas->LineTo(x+cos(j)*(r-10),y+sin(j)*(r-10)); j=-1.57+3.14*25/30; Canvas->Pen->Width=1; Canvas->MoveTo(x+cos(j)*(r-30),y+sin(j)*(r-30)); Canvas->LineTo(x+cos(j)*(r-10),y+sin(j)*(r-10)); j=-1.57+3.14*30/30; Canvas->Pen->Width=2; Canvas->MoveTo(x+cos(j)*(r-50),y+sin(j)*(r-50)); Canvas->LineTo(x+cos(j)*(r-10),y+sin(j)*(r-10)); j=-1.57+3.14*35/30; Canvas->Pen->Width=1; Canvas->MoveTo(x+cos(j)*(r-30),y+sin(j)*(r-30)); Canvas->LineTo(x+cos(j)*(r-10),y+sin(j)*(r-10)); j=-1.57+3.14*40/30; Canvas->Pen->Width=1; Canvas->MoveTo(x+cos(j)*(r-30),y+sin(j)*(r-30)); Canvas->LineTo(x+cos(j)*(r-10),y+sin(j)*(r-10)); j=-1.57+3.14*45/30; Canvas->Pen->Width=2; Canvas->MoveTo(x+cos(j)*(r-50),y+sin(j)*(r-50)); Canvas->LineTo(x+cos(j)*(r-10),y+sin(j)*(r-10)); j=-1.57+3.14*50/30; Canvas->Pen->Width=1; Canvas->MoveTo(x+cos(j)*(r-30),y+sin(j)*(r-30)); Canvas->LineTo(x+cos(j)*(r-10),y+sin(j)*(r-10)); j=-1.57+3.14*55/30; Canvas->Pen->Width=1; Canvas->MoveTo(x+cos(j)*(r-30),y+sin(j)*(r-30)); Canvas->LineTo(x+cos(j)*(r-10),y+sin(j)*(r-10)); } //--------------------------------------------------------------------------- void TForm1::DrawBmp(int x,int y,int n) { /* switch(n) { case 0: Canvas->Draw(x,y,Bmp0); break; case 1: Canvas->Draw(x,y,Bmp1); break; case 2: Canvas->Draw(x,y,Bmp2); break; case 3: Canvas->Draw(x,y,Bmp3); break; case 4: Canvas->Draw(x,y,Bmp4); break; case 5: Canvas->Draw(x,y,Bmp5); break; case 6: Canvas->Draw(x,y,Bmp6); break; case 7: Canvas->Draw(x,y,Bmp7); break; case 8: Canvas->Draw(x,y,Bmp8); break; case 9: Canvas->Draw(x,y,Bmp9); break; case 10: Canvas->Draw(x,y,Bmpc); break; } */ } //--------------------------------------------------------------------------- void __fastcall TForm1::FormCreate(TObject *Sender) { // ShowCursor(false); } //--------------------------------------------------------------------------- |
![]() |
送花文章: 1540,
![]() |