I have the following code in C#
below:
short* gArray = stackalloc short[3 * 256];
would like the equivalent in VB.net
I tried to do the conversion, with some different online tools, but it only returns me as a type of Invalid Syntax and / or does not exist for the VB.net syntax structure.
If it is possible to chat between syntaxes, as I do in a simplified way (any other types of code, such as Integers, Booleans, among others)
This is the complete code used in C#
public static unsafe bool SetBrightness(int brightnessValue)
{
if (brightnessValue > 255)
brightnessValue = 255;
if (brightnessValue < 0)
brightnessValue = 0;
short* gArray = stackalloc short[3 * 256];
short* idx = gArray;
for (int j = 0; j < 3; j++)
{
for (int i = 0; i < 256; i++)
{
int arrayVal = i * (brightnessValue + 128);
if (arrayVal > 65535)
arrayVal = 65535;
*idx = (short)arrayVal;
idx++;
}
}
}