Can't get LoadImage working

I need to open a image and transform to byte to run by LoadImage
here is my code:

`
Texture2D defaultMapTexture = new Texture2D(512, 512, TextureFormat.ARGB32, false);

string completedPath = “file://C:/a.bmp”;

byte textureData = File.ReadAllBytes(completedPath);

defaultMapTexture.LoadImage(textureData);

defaultMapTexture.Apply();

Rect rect = new Rect(20f, 20f, 1106, 906);

GUI.DrawTexture(rect, defaultMapTexture);
`

numberkruncher is right… Documentation says:

This function loads a JPG or PNG image from raw byte array

Here is the documentation that says that you need JPG or PNG

Convert to jpg or png and you will be good to go.

not sure if file’s location is relevant, but you could add it to your assets folder and use Resources.Load, if it does not gives you the texture, try with the file a.PNG moving it to assets/Resources

Texture2D myTexture = Resources.Load(“a.PNG”) as Texture2D;

then draw it where you want it.

GUI.DrawTexture(rect, myTexture);