简体   繁体   中英

convert code from vb6 to code in c#

I read this code in VB6 ,How can I write this code in c# languge

Type pix

b As Byte
g As Byte
R As Byte

End Type

Public img() As pix

wi=320
hi=240

ReDim img(wi, hi)

C#

public struct pix
{
    public byte r;
    public byte g;
    public byte b;
}

public pix[,] img;
int wi = 320;
int hi = 240;

img = new pix[wi, hi];

If you are looking for ReDim Preserve , see this Redim Preserve in C#?

Go to this website . you can paste your VB code and Click C# as an output and click convert. and you are done.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM