SFML.Graphics.Image.Image C# (CSharp) Method

Image() public method

Construct the image from a file in memory
public Image ( byte bytes ) : System
bytes byte Byte array containing the file contents
return System
        public Image(byte[] bytes) :
            base(IntPtr.Zero)
        {
            GCHandle pin = GCHandle.Alloc(bytes, GCHandleType.Pinned);
            try
            {
                CPointer = sfImage_createFromMemory(pin.AddrOfPinnedObject(), Convert.ToUInt64(bytes.Length));
            }
            finally
            {
                pin.Free();
            }
            if (CPointer == IntPtr.Zero)
                throw new LoadingFailedException("image");
        }

Same methods

Image::Image ( System.Color pixels ) : System
Image::Image ( Image copy ) : System
Image::Image ( IntPtr cPointer ) : System
Image::Image ( System.Stream stream ) : System
Image::Image ( string filename ) : System
Image::Image ( uint width, uint height ) : System
Image::Image ( uint width, uint height, System.Color color ) : System
Image::Image ( uint width, uint height, byte pixels ) : System