I’m trying to convert an image to Texture2d. It seems like the following code should work, but the result is a 8x8 Texture2D. How does one do this?
Edit: I should also mention this “Image” is a Vuforia image.
public static Texture2D Image2Texture(Image im)
{
if (im == null)
{
return new Texture2D(4,4);
}
//make a new Texture2D
Texture2D tex = new Texture2D(im.Width, im.Height);
tex.LoadImage(im.Pixels);
return tex;
}