这段BCB代码如何转换为Delphi代码???(200分)

F

fengdi

Unregistered / Unconfirmed
GUEST, unregistred user!
下面这段代码是用BCB写的,想转换为Delphi的,怎么做???
哪位大虾能写出转换为Delphi以后的代码。
#include
  #include
  #include
  #include
  void MoveView(int x,int y);
  void main(void){
   int gdriver,gmode;
   gdriver=DETECT,gmode=0;
   initgraph(&gdriver,&gmode,"BORLANDCBGI");
   rectangle(100,100,200,200);
   outtextxy(100,250,"Press Any Key to SHAKE ...");
   getch();
   for(int i=0;i<20;i++){
   MoveView(10-random(20),5-random(10));
   delay(50);
   }
   MoveView(0,0);
   getch();
   closegraph();
   }
  void MoveView(int x,int y){
   union{
   unsigned int whole;
   char low;
   }adr;
   unsigned char high,low;
   adr.whole=y*80+x/8,
   low=adr.low,
   high=(unsigned char)(adr.whole>>8);
   outportb(0x3D4,0X0C);
   outportb(0x3D5,high);
   outportb(0x3D4,0x0D);
   outportb(0x3D5,low);
   }

 
是dos程序吧???可惜我C语法忘了,帮你up一下。
 
佩服,好好看看初级材料去吧.
 
main中的大概可以用TCanvas来模仿,
在MoveView中的好像直接操作端口(outportb?),不知道了
 
笨,你贴到borland的新闻组,2小时搞定。
分记得给我哦
 
根据我的多年的 Delphi to BCB 翻译经验,无法翻译,cause delphi use vcl lib from 95.
 
同意,不是bcb,而是BC
 
接受答案了.
 

Similar threads

I
回复
0
查看
889
import
I
I
回复
0
查看
738
import
I
I
回复
0
查看
818
import
I
I
回复
0
查看
602
import
I
顶部