开发者

Multidimension array in VB.net (ASP.net)

开发者 https://www.devze.com 2023-01-02 01:09 出处:网络
How do I create a multidimension array in VB.net?I want to specify the dimensions of the array in the code, but the array must be global.

How do I create a multidimension array in VB.net? I want to specify the dimensions of the array in the code, but the array must be global.

Dim canvas()() As Integer

Then later on

x = someVal开发者_运维知识库ue
y = someValue
canvas = New Integer(x)(y)

Cheers!


One thing to note, arrays are zero based.

Dim foo(,) As Byte
Dim img As New Bitmap(8, 8)
ReDim foo(img.Width - 1, img.Height - 1)


Just worked it out

Dim canvas(,) As Integer
ReDim canvas(canvasWidth, canvasHeight)
0

精彩评论

暂无评论...
验证码 换一张
取 消