unity load image from file

Hi how do i load an image from a folder that is not resoruces? like aplication.datapath/maps or somethinmg?

I am not sure I understand your question. You could import your image as a sprite or texture and go from there.

Hi, try it

string txtName = "smile.png";  // your filename
Vector2 size = new Vector2(256, 256); // image size

Texture2D texture = loadImage(size, Path.GetFullPath(txtName));

private static Texture2D loadImage(Vector2 size, string filePath) {
        
        byte[] bytes = File.ReadAllBytes(filePath);
        Texture2D texture = new Texture2D((int)size.x, (int)size.y, TextureFormat.RGB24, false);
        texture.filterMode = FilterMode.Trilinear;
        texture.LoadImage(bytes);

        return texture;
    }