VB9.0 point()能用變數嗎

dim pp() as point

dim a ,b as integer

pp()能不能等於(a,b)

pp()=(a,b)

我寫不出來

我有好幾萬的座標計算完要輸入進去

怎麼做~"~

Update:

補充一下

我是要做填滿的

g.FillPolygon(brush, arrPoint)

想要那上萬點計算出來的座標連成的圖案填滿顏色

Update 2:

g.FillPolygon(brush, pp)

pp = 座標資料

Update 3:

是陣列哦

原先範例是寫pp() = {new point(1,1),new point(2,2),new point(3,3)}

3 Answers

Rating
  • 1 decade ago
    Favorite Answer

    dim point(,) as point

    redim preserve pp(x)

    pp(x) = New Point(a, b) 可以嗎- -?

    2010-08-23 02:14:05 補充:

    打錯= =" 是 dim pp() as point

    沒有逗號.. 也不是dim point() 有逗號的話會變成二維

    2010-08-26 14:12:25 補充:

    那你pp不用宣告成陣列吧

    計一個填一個!_!

    2010-08-27 00:17:02 補充:

    總知 資料型態上

    要用數字換成 Point 必需要加上New

    陣列沒有定義大小就要redim 大小 然後才放上資料

    dim pp() as point

    dim x as integer = 0, y as integer = 0 , i as integer

    Redim Preserve pp(i)

    pp(i) = New Point(x,y)

  • 1 decade ago

    我打在文字檔裡面,不好意思,我再計算的時是用whlie在跑,能納入whlie裡面吼?!

  • 1 decade ago

    Dim pp As New List(Of Point)

    Dim a, b As Integer

    pp.Add(New Point(a, b))

    ======================

    PS: 不要把上萬筆的座標都寫在程式碼中。

Still have questions? Get your answers by asking now.