DEXTUpload.NET Professional
menu toggleReferences > DEXTUpload.NET > ImageSaveOption

DEXTUpload.NET
Class ImageSaveOption

The minimum supported version
5.0.0.0
The minimum support environment
.NET Framework 4.0
Explanation

The "ImageSaveOption" is a class that includes a setting to save a "System.Drawig.Image" object as an image file.

This class's instance is used in the" SaveImage, ConvertImage" methods of the "DEXTUpload.NET.ImageProc" class.

var source = new FileInfo("source.jpg");
var target = new FileInfo("target.png");

ImageProc.ConvertImage(source, target, new ImageSaveOption {
    IsOverwrite = true,
    OutputFormat = ImageFormat.Png
});
Type
public class ImageSaveOption
Constructors

ImageSaveOption

  • Does initialization when creating an instance of the "ImageSaveOption" class.

  • Type

    public ImageSaveOption()
    public ImageSaveOption(uint quality, ImageFormat format, bool overwrite))
  • Parameters

    Name Type Explanation
    quality System.UInt32 The image quality.
    format System.Drawing.ImageFormat An object that represents the format of the image to be saved.
    overwrite System.Boolean If there is a file with the same file name, to specify whether you want to overwrite.
Properties

Quality

  • Gets or sets a category of image quality.

    Sets the field of the "Quality" in the encoder that is used when storing the image format. The "Quality" refers to the compression level of the image, it can be specified from 0 to 100. If the number is low enough, compression ratio increases, the image quality is degraded.

    The default is 85. If you set the property value to 100, the size of the file is increased than the original image.

  • Type

    public uint Quality { get; set; }

OutputFormat

  • Gets or sets the "System.Drawing.ImageFormat" object that represents the format of the image to be saved.

    By default, it is "ImageFormat.Jpeg".

  • Type

    public ImageFormat OutputFormat { get; set; }

IsOverwrite

  • Gets or sets whether or not to overwrite the file if there is a file of the same name.

    Overwriting is that the subject is deleted first and new file will be saved with the same name.

    By default, it is "false", if a file with the same name exists, when it saves the temporary file to destination, the number of the suffix is attached to the end of the file name.

    In contrast, if it is "true", when a file with the same name exists, it deletes the file in the destination and saves temporary file with the same name to the destination.

    Some crashes can occur when a number of processes and threads create files with same name at the same time.

  • Type

    public bool IsOverwrite { get; set; }