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.
Property Name | Description |
---|---|
Title | Changes the Title (not the name) of the task. |
Source | The Full File Path and Name of the Source image file to resize, including its extension. |
Destination | The Full File Path and Name of the image file to create, including its extension. |
Constant Name | The 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. |
Overwrite | TRUE to overwrite an existing image, FALSE to keep the existing image. |
Width | The new width of the image in pixels. |
Height | The new height of the image in pixels. |
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.
Property Name | Example Rule | Example Result | Meaning |
---|---|---|---|
Source | "C:\MyDocuments\Content\Images\WorldGraphic.png" | C:\MyDocuments\Content\Images\WorldGraphic.png | This is the Full File Path and Name including extension to the source file to use. |
Destination | FsGetFullPath("<Specification>\ResizedWorldGraphic.png") | C:\MyDocuments\Projects\Specifications\Spec 9999\ResizedWorldGraphic.png | This is the location where the new file will be created. |
Constant Name | "DWConstantReport" | DWConstantReport | This is the name of the Constant that the Task will report to. |
Overwrite | TRUE | TRUE | TRUE will overwrite the file if it exists FALSE will not. |
Width | 600 | 600 | This will set the width of the new image created to 600 pixels. |
Height | 600 | 600 | This will set the height of the new image created to 600 pixels. |
This is the source image that will be used.
The image is 600 pixels wide by 450 pixels high.
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.
To resize this image and keep the original aspect ratio one of the Height or Width property must be set to 0:
Property Name | Example Rule | Example Result | Meaning |
---|---|---|---|
Source | "C:\MyDocuments\Content\Images\WorldGraphic.png" | C:\MyDocuments\Content\Images\WorldGraphic.png | This is the Full File Path and Name including extension to the source file to use. |
Destination | FsGetFullPath("<Specification>\ResizedWorldGraphic.png") | C:\MyDocuments\Projects\Specifications\Spec 9999\ResizedWorldGraphic.png | This is the location where the new file will be created. |
Constant Name | "DWConstantReport" | DWConstantReport | This is the name of the Constant that the Task will report to. |
Overwrite | TRUE | TRUE | TRUE will overwrite the file if it exists FALSE will not. |
Width | 0 | 0 | This will set the width of the new image created to 600 pixels. |
Height | 300 | 300 | This 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.
This is the source image that will be used.
The image is 600 pixels wide by 450 pixels high.
The resized image can be seen below. The aspect ratio has been maintained while also rescaling the image.