View Single Post
  #1 (permalink)  
Old 08-14-2007, 09:53 AM
hung hung is offline
Junior Member
 
Join Date: Jul 2007
Location: Hong Kong
Posts: 42
Send a message via MSN to hung Send a message via Yahoo to hung Send a message via Skype™ to hung
Default How to access the 2nd dimension

I have declare array as below:

dim type (x, y) shape(1000, 500)
first dimension is points in a polygon shape, e.g. shape(0, 1) to shape(1000,1) , that I use to draw polygon. shape(0, 2) to shape(1000,2) refers to another polygon.

when draw polygon, I use the code below:

for jj = 0 to cntshape - 1
for ii = 0 to cntpt(jj) - 1
ptstmp(ii).x = shape(ii, jj).x
ptstmp(ii).y = shape(ii, jj).y
next
form1.polygon(ptstmp(), 0, cntpt(jj) - 1, cBlack, F)
next


I found that in PPC, the above for ii loop takes time (i.e. slow as one second when draw over 10 shapes).

If I can refer to one of the dimension I should be able to avoid the for ii loop.
e.g.
form1.polygon(shape(,jj), 0, cntpt(jj) -1 , cBlack, F)

Or any other way to do so?
__________________
Yours,

Dopod D810 WM6 GPS HSDPA 3G Wifi Bluetooth
Reply With Quote