/// <summary> /// Creates an image object from bytes. /// </summary> /// <param name="stream">Stream of bytes</param> public Image(MemoryStream stream) { if (stream == null || stream.Length == 0) { throw new Errors.NullImageError(); } _bitmap = (Bitmap)Bitmap.FromStream(stream, false, false); stream.Dispose(); COMDisposable.Subscribe(this, typeof(ComInterfaces._Image)); }
/// <summary> /// Creates a new WebDriver object. /// </summary> public WebDriver() { UnhandledException.Initialize(); RegisterRunningObject(); COMDisposable.Subscribe(this, typeof(ComInterfaces._WebDriver)); }
/// <summary> /// Creates a new empty PDF /// </summary> public PdfFile() { _writer = new PdfWriter(); _writer.AddPage(_pageWidthPt, _pageHeightPt); COMDisposable.Subscribe(this, typeof(ComInterfaces._PdfFile)); }
/// <summary> /// Creates an image object from a bitmap /// </summary> /// <param name="image"></param> public Image(Bitmap image) { _bitmap = image; COMDisposable.Subscribe(this, typeof(ComInterfaces._Image)); }