Convert image from file to byte[]?
Hello, I need help, how convert Image ("data/image.png") to bytes[] ?
Clarify, what do you mean by "a file"? Could you show some code?
5b6ed4c9ac8e4.jpg misticos
Clarify, what do you mean by "a file"? Could you show some code?

It doesnt work

private void OnServerInitialized()
        {
            img.name = "test";
            img.url = "file://" + Interface.Oxide.DataDirectory + Path.DirectorySeparatorChar + "test.png";
            byte[] bytes = getImgSize(img.url);
            if(bytes == null)
            {
                Server.Broadcast("null");
                return;
            }
            ImageLibrary.Call("AddImageData", img.name, bytes, 123);

        }

        private byte[] getImgSize(string url)
        {
            WWW www = new WWW(url);
            if (string.IsNullOrEmpty(www.error))
            {
                return http://www.bytes;

            }
            return null;
        }
5b6ed4c9ac8e4.jpg misticos
Clarify, what do you mean by "a file"? Could you show some code?

Image doesnt add to storage



Merged post

Can anybody help ?