Home Search

DriveWorks Pro 21
Resize Image

Send Feedback

Resize Image

This Specification Macro Task will resize an image. The Task allows you to define a new height and a new width that can be smaller or bigger than the original dimensions of the Source file.

If one of the properties Height or Width is set to 0, then DriveWorks will perform a scaling of the image, keeping its original proportions and using the other property value as a target.

Properties

Property NameDescription
TitleChanges the Title (not the name) of the task.
SourceThe Full File Path and Name of the Source image file to resize, including its extension.
DestinationThe Full File Path and Name of the image file to create, including its extension.
Constant NameThe name of the Constant used to report on the success of the Task. If it is a success this will be used to store the path of the generated image.
OverwriteTRUE to overwrite an existing image, FALSE to keep the existing image.
WidthThe new width of the image in pixels.
HeightThe new height of the image in pixels.

Example

When this Task is added the properties are static. To be able to build rules on a static properties see How To: Change A Static Property To A Dynamic Property.

Simple Example

Property NameExample RuleExample ResultMeaning
Source"C:\MyDocuments\Content\Images\WorldGraphic.png"C:\MyDocuments\Content\Images\WorldGraphic.pngThis is the Full File Path and Name including extension to the source file to use.
DestinationFsGetFullPath("<Specification>\ResizedWorldGraphic.png")C:\MyDocuments\Projects\Specifications\Spec 9999\ResizedWorldGraphic.pngThis is the location where the new file will be created.
Constant Name"DWConstantReport"DWConstantReportThis is the name of the Constant that the Task will report to.
OverwriteTRUETRUETRUE will overwrite the file if it exists FALSE will not.
Width600600This will set the width of the new image created to 600 pixels.
Height600600This will set the height of the new image created to 600 pixels.

Source Image

This is the source image that will be used.

Source image that is used for the example

The image is 600 pixels wide by 450 pixels high.

Result

The resized image can be seen below. The Image is now 600x600 pixels.

The image has been resized but the aspect ratio has not been maintained.

Aspect Ratio Maintained Example

To resize this image and keep the original aspect ratio one of the Height or Width property must be set to 0:

Property NameExample RuleExample ResultMeaning
Source"C:\MyDocuments\Content\Images\WorldGraphic.png"C:\MyDocuments\Content\Images\WorldGraphic.pngThis is the Full File Path and Name including extension to the source file to use.
DestinationFsGetFullPath("<Specification>\ResizedWorldGraphic.png")C:\MyDocuments\Projects\Specifications\Spec 9999\ResizedWorldGraphic.pngThis is the location where the new file will be created.
Constant Name"DWConstantReport"DWConstantReportThis is the name of the Constant that the Task will report to.
OverwriteTRUETRUETRUE will overwrite the file if it exists FALSE will not.
Width00This will set the width of the new image created to 600 pixels.
Height300300This will set the height of the new image created to 600 pixels.

Notice the Property Width is 0, and only the Property Height has a value of 300 pixels high.

DriveWorks will automatically rescale the image and keep the original aspect ratio.

Source Image

This is the source image that will be used.

Source image that is used for the example

The image is 600 pixels wide by 450 pixels high.

Result

The resized image can be seen below. The aspect ratio has been maintained while also rescaling the image.