2007年11月8日 星期四

week8



這星期把之前恐怖的暴力程式碼改成迴圈了XD

原本的:

x=0;c=59;d=59;IMG[0]->Canvas->CopyRect(Rect(a,b,c,d),Image1->Canvas,Rect(x,y,x+c,y+d)); x+=59;c+=59;d+=59; Image02->Canvas->CopyRect(Rect(a,b,c,d),Image1->Canvas,Rect(x,y,x+c,y+d)); x+=59;c+=59;d+=59; Image03->Canvas->CopyRect(Rect(a,b,c,d),Image1->Canvas,Rect(x,y,x+c,y+d)); x=0;y+=59;c=59;d=59; Image04->Canvas->CopyRect(Rect(a,b,c,d),Image1->Canvas,Rect(x,y,x+c,y+d)); x+=59;c+=59;d+=59; Image05->Canvas->CopyRect(Rect(a,b,c,d),Image1->Canvas,Rect(x,y,x+c,y+d)); x+=59;c+=59;d+=59; Image06->Canvas->CopyRect(Rect(a,b,c,d),Image1->Canvas,Rect(x,y,x+c,y+d)); x=0;y+=59;c=59;d=59; Image07->Canvas->CopyRect(Rect(a,b,c,d),Image1->Canvas,Rect(x,y,x+c,y+d)); x+=59;c+=59;d+=59; Image08->Canvas->CopyRect(Rect(a,b,c,d),Image1->Canvas,Rect(x,y,x+c,y+d)); x+=59;c+=59;d+=59; Image09->Canvas->CopyRect(Rect(a,b,c,d),Image1->Canvas,Rect(x,y,x+c,y+d));

(沒什麼意思.就是寫了9次...)

現在的

for (i=0; i<9; 3="=" x="0;" c="59;" d="59;">Canvas->CopyRect(Rect(a,b,c,d),Image1->Canvas,Rect(x,y,x+c,y+d)); //主要複製程式 }

(好多了XD)

不過這星期的部分還是很暴力

還要再改過XD

沒有留言:

張貼留言