internal static XImage FromImportedImage(ImportedImage image) { if (image == null) { throw new ArgumentNullException("image"); } return(new XImage(image)); }
/// <summary> /// Initializes a new instance of the <see cref="XImage"/> class from an image read by ImageImporter. /// </summary> /// <param name="image">The image.</param> /// <exception cref="System.ArgumentNullException">image</exception> XImage(ImportedImage image) { if (image == null) { throw new ArgumentNullException("image"); } _importedImage = image; Initialize(); }
/// <summary> /// Creates an image from the specified stream.<br/> /// Silverlight supports PNG and JPEF only. /// </summary> /// <param name="stream">The stream containing a BMP, PNG, GIF, JPEG, TIFF, or PDF file.</param> /// <param name="platformIndependent">Uses an platform-independent implementation if set to true. /// The platform-dependent implementation, if available, will support more image formats.</param> /// <param name="document">The document used to obtain the options.</param> internal static XImage FromStream(Stream stream, bool platformIndependent, PdfDocument document) { if (!platformIndependent) { return(FromStream(stream)); } // TODO: Check PDF file. ImageImporter ii = ImageImporter.GetImageImporter(); ImportedImage i = ii.ImportImage(stream, document); if (i == null) { throw new InvalidOperationException("Unsupported image format."); } XImage image = new XImage(i); image._stream = stream; return(image); }
internal static XImage FromImportedImage(ImportedImage image) { if (image == null) throw new ArgumentNullException("image"); return new XImage(image); }
/// <summary> /// Initializes a new instance of the <see cref="XImage"/> class from an image read by ImageImporter. /// </summary> /// <param name="image">The image.</param> /// <exception cref="System.ArgumentNullException">image</exception> XImage(ImportedImage image) { if (image == null) throw new ArgumentNullException("image"); _importedImage = image; Initialize(); }