JIEMIAN.CPP
上传用户:wszmarenbt
上传日期:2013-04-26
资源大小:2552k
文件大小:1k
源码类别:

Windows编程

开发平台:

Visual C++

  1. #include<graphics.h>
  2. #include<dos.h>
  3. #include<ALLOC.H>
  4. #include<STDLIB.H>
  5. #include<conio.h>
  6. void main()
  7. {
  8. int driver=DETECT,mode;
  9. int X1=1,Y1=1,X2=10,Y2=300,
  10.     X3=630,Y3=1,X4=640,Y4=300;
  11. int NUM;
  12. unsigned SIZE1,SIZE2;
  13. char far *BUFFER1;
  14. char far *BUFFER2;
  15. registerbgidriver(EGAVGA_driver);
  16. initgraph(&driver,&mode,"");
  17. setfillstyle(1,WHITE);
  18. bar(1,1,640,500);
  19. setfillstyle(1,YELLOW);
  20. bar(X1,Y1,X2,Y2);
  21. SIZE1=imagesize(X1,Y1,X2,Y2);
  22. setfillstyle(1,BLUE);
  23. bar(X3,Y3,X4,Y4);
  24. SIZE2=imagesize(X3,Y3,X4,Y4);
  25. BUFFER1=(char far *)malloc(SIZE1);
  26. BUFFER2=(char far *)malloc(SIZE2);
  27. getimage(X1,Y1,X2,Y2,BUFFER1);
  28. getimage(X3,Y3,X4-1,Y4,BUFFER2);
  29. for(NUM=0;NUM<50;NUM++)
  30. {
  31. putimage(X1,Y1,BUFFER1,COPY_PUT);
  32. putimage(X3,Y3,BUFFER2,COPY_PUT);
  33. delay(50);
  34. X1+=10;
  35. X3-=10;
  36. }
  37. setcolor(RED);
  38. outtextxy(200,400,"*** WELL COME TO THIS SYSTEM ! ***");
  39. getch();
  40. closegraph();
  41. }