ZennoLab Assemblies Documentation
ImageProcessingResizeFromFile Method (ZennoPoster)
Example 

Type: System.String

The file path of the image for processing.

Type: System.String

The save file path.

Type: System.Int32

A new width of the image.

Type: System.Int32

A new height of the image.

Type: System.String

Units of dimension of the parameters. It can be "pixel" or "percent".

Type: System.String

If need to keep the aspect ratio then "true"; otherwise "false".

Type: System.String

If not increase size of the image then "true"; otherwise "false".

Type: System.Int32

The image quality. The value from 0 to 100. Default value is 100.

Type: System.String

The Exif Tags for metadata of image. Default value is empty string. Each tag must be written from a new line. The format of data is follow: {TagName}|{TagValue}.

Performs resizing of the image from file.
Syntax
public static void ImageProcessingResizeFromFile( 
   string filePath,
   string savePath,
   int width,
   int height,
   string units,
   bool keep,
   bool notIncImage,
   int quality,
   string exif
)

Parameters

filePath

Type: System.String

The file path of the image for processing.

savePath

Type: System.String

The save file path.

width

Type: System.Int32

A new width of the image.

height

Type: System.Int32

A new height of the image.

units

Type: System.String

Units of dimension of the parameters. It can be "pixel" or "percent".

keep

Type: System.String

If need to keep the aspect ratio then "true"; otherwise "false".

notIncImage

Type: System.String

If not increase size of the image then "true"; otherwise "false".

quality

Type: System.Int32

The image quality. The value from 0 to 100. Default value is 100.

exif

Type: System.String

The Exif Tags for metadata of image. Default value is empty string. Each tag must be written from a new line. The format of data is follow: {TagName}|{TagValue}.

Remarks

The default value of the units parameter is "pixel".

If parameter of quality not in the range from 0 to 100 then this value will be changed to 100.

Example
The following example shows call the ImageProcessingResizeFromFile method.
// resize image from file, the width and height in pixel
ZennoPoster.ImageProcessingResizeFromFile("C:\\ImageForResize.jpeg", "C:\\ResultImage.jpeg", 100, 120, "pixel", true, false);
 
// resize image from file, the width and height in percentage
ZennoPoster.ImageProcessingResizeFromFile("C:\\ImageForResize.jpeg", "C:\\ResultImage.jpeg", 200, 200, "percent", true, false);
// resize image from file, the width and height in pixel
ZennoLab\CommandCenter\ZennoPoster.ImageProcessingResizeFromFile("C:\\ImageForResize.jpeg", "C:\\ResultImage.jpeg", 100, 120, "pixel", true, false);
 
// resize image from file, the width and height in percentage
ZennoLab\CommandCenter\ZennoPoster.ImageProcessingResizeFromFile("C:\\ImageForResize.jpeg", "C:\\ResultImage.jpeg", 200, 200, "percent", true, false);
Requirements

Target Platforms: Desktop: Windows XP SP3 and older. Server: Windows Server 2003 and older.

See Also

Reference

ZennoPoster Class
ZennoPoster Members
ImageProcessingClearExifFromFile Method
ImageProcessingClearExifFromScreenshot Method
ImageProcessingClearExifFromUrl Method
ImageProcessingCropFromFile Method
ImageProcessingCropFromScreenshot Method
ImageProcessingCropFromUrl Method
ImageProcessingMirrorFromFile Method
ImageProcessingMirrorFromScreenshot Method
ImageProcessingMirrorFromUrl Method
ImageProcessingResizeFromScreenshot Method
ImageProcessingResizeFromUrl Method
ImageProcessingRotateFromFile Method
ImageProcessingRotateFromScreenshot Method
ImageProcessingRotateFromUrl Method
ImageProcessingUntreatedFromFile Method
ImageProcessingUntreatedFromScreenshot Method
ImageProcessingUntreatedFromUrl Method
ImageProcessingWaterMarkImageFromFile Method
ImageProcessingWaterMarkImageFromScreenshot Method
ImageProcessingWaterMarkImageFromUrl Method
ImageProcessingWaterMarkTextFromFile Method
ImageProcessingWaterMarkTextFromScreenshot Method
ImageProcessingWaterMarkTextFromUrl Method

Send Feedback