private void SetDefines([ValidatedNotNull] IWriteDefines defines) { foreach (MagickImage image in _Images) { image.Settings.SetDefines(defines); } }
/// <summary> /// Writes the imagse to the specified stream. If the output image's file format does not /// allow multi-image files multiple files will be written. /// </summary> /// <param name="stream">The stream to write the images to.</param> /// <param name="defines">The defines to set.</param> /// <param name="cancellationToken">The token to monitor for cancellation requests.</param> /// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns> /// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception> public Task WriteAsync(Stream stream, IWriteDefines defines, CancellationToken cancellationToken) { SetDefines(defines); return(WriteAsync(stream, defines.Format, cancellationToken)); }
/// <summary> /// Writes the imagse to the specified stream. If the output image's file format does not /// allow multi-image files multiple files will be written. /// </summary> /// <param name="stream">The stream to write the images to.</param> /// <param name="defines">The defines to set.</param> /// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns> /// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception> public Task WriteAsync(Stream stream, IWriteDefines defines) => WriteAsync(stream, defines, CancellationToken.None);
/// <summary> /// Writes the images to the specified file name. If the output image's file format does not /// allow multi-image files multiple files will be written. /// </summary> /// <param name="fileName">The fully qualified name of the image file, or the relative image file name.</param> /// <param name="defines">The defines to set.</param> /// <param name="cancellationToken">The token to monitor for cancellation requests.</param> /// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns> /// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception> public Task WriteAsync(string fileName, IWriteDefines defines, CancellationToken cancellationToken) { SetDefines(defines); return(WriteAsync(fileName, defines.Format, cancellationToken)); }
/// <summary> /// Writes the images to the specified file name. If the output image's file format does not /// allow multi-image files multiple files will be written. /// </summary> /// <param name="fileName">The fully qualified name of the image file, or the relative image file name.</param> /// <param name="defines">The defines to set.</param> /// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns> /// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception> public Task WriteAsync(string fileName, IWriteDefines defines) => WriteAsync(fileName, defines, CancellationToken.None);
/// <summary> /// Writes the images to the specified file. If the output image's file format does not /// allow multi-image files multiple files will be written. /// </summary> /// <param name="file">The file to write the image to.</param> /// <param name="defines">The defines to set.</param> /// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns> /// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception> public Task WriteAsync(FileInfo file, IWriteDefines defines) => WriteAsync(file, defines, CancellationToken.None);
/// <summary> /// Writes the images to the specified buffer writter. If the output image's file format does not /// allow multi-image files multiple files will be written. /// </summary> /// <param name="bufferWriter">The buffer writer to write the images to.</param> /// <param name="defines">The defines to set.</param> /// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception> public void Write(IBufferWriter <byte> bufferWriter, IWriteDefines defines) { SetDefines(defines); Write(bufferWriter, defines.Format); }
/// <summary> /// Writes the image to the specified file. /// </summary> /// <param name="file">The file to write the image to.</param> /// <param name="defines">The defines to set.</param> /// <param name="cancellationToken">The token to monitor for cancellation requests.</param> /// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns> /// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception> public Task WriteAsync(FileInfo file, IWriteDefines defines, CancellationToken cancellationToken) { _settings.SetDefines(defines); return(WriteAsync(file, defines.Format, cancellationToken)); }
///<summary> /// Writes the images to the specified file name. If the output image's file format does not /// allow multi-image files multiple files will be written. ///</summary> ///<param name="fileName">The fully qualified name of the image file, or the relative image file name.</param> ///<param name="defines">The defines to set.</param> ///<exception cref="MagickException"/> public void Write(string fileName, IWriteDefines defines) { SetDefines(defines); Write(fileName); }
///<summary> /// Writes the imagse to the specified stream. If the output image's file format does not /// allow multi-image files multiple files will be written. ///</summary> ///<param name="stream">The stream to write the images to.</param> ///<param name="defines">The defines to set.</param> ///<exception cref="MagickException"/> public void Write(Stream stream, IWriteDefines defines) { SetDefines(defines); SetFormat(defines.Format); Write(stream); }
///<summary> /// Writes the images to the specified file. If the output image's file format does not /// allow multi-image files multiple files will be written. ///</summary> ///<param name="file">The file to write the image to.</param> ///<param name="defines">The defines to set.</param> ///<exception cref="MagickException"/> public void Write(FileInfo file, IWriteDefines defines) { SetDefines(defines); Write(file); }