コード例 #1
0
 private void SetDefines([ValidatedNotNull] IWriteDefines defines)
 {
     foreach (MagickImage image in _Images)
     {
         image.Settings.SetDefines(defines);
     }
 }
コード例 #2
0
 /// <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));
 }
コード例 #3
0
 /// <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);
コード例 #4
0
 /// <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));
 }
コード例 #5
0
 /// <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);
コード例 #6
0
 /// <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);
コード例 #7
0
 /// <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);
 }
コード例 #8
0
 /// <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));
 }
コード例 #9
0
 ///<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);
 }
コード例 #10
0
 ///<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);
 }
コード例 #11
0
 ///<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);
 }