System.Drawing.Bitmap.Bitmap C# (CSharp) Method

Bitmap() public method

public Bitmap ( Stream stream, bool useIcm ) : AppKit
stream System.IO.Stream
useIcm bool
return AppKit
        public Bitmap(Stream stream, bool useIcm)
        {
            if (stream == null)
                throw new ArgumentNullException ("Value can not be null");

            // false: stream is owned by user code
            //nativeObject = InitFromStream (stream);
            // TODO
            // Use Image IO
            byte[] buffer;
            using(var memoryStream = new MemoryStream())
            {
                stream.CopyTo(memoryStream);
                buffer = memoryStream.ToArray();
            }

            dataProvider = new CGDataProvider(buffer, 0, buffer.Length);

            InitializeImageFrame (0);
        }

Same methods

Bitmap::Bitmap ( Image image ) : AppKit
Bitmap::Bitmap ( Image original, Size newSize ) : AppKit
Bitmap::Bitmap ( Image original, int width, int height ) : AppKit
Bitmap::Bitmap ( int width, int height ) : AppKit
Bitmap::Bitmap ( int width, int height, PixelFormat format ) : AppKit
Bitmap::Bitmap ( string filename ) : AppKit