This Specification Macro Task will crop an image into a rectangular shape. You can choose where to crop by defining the position of the top left corner as well as the width and height of the rectangle to crop.
You will have to make sure that the rectangular shape you want to crop is within the boundary of the Source image.
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 crop, 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. |
Left Point | The left value of the rectangle to crop in pixels. |
Top Point | The top value of the rectangle to crop in pixels. |
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>\CroppedWorldGraphic.png") | C:\MyDocuments\Projects\Specifications\Spec 9999\CroppedWorldGraphic.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. |
Left Point | 240 | 240 | This is the distance in pixels from the left side of the image. |
Top Point | 125 | 125 | This is the distance down from the top side of the image. |
Width | 255 | 255 | This is the width in pixels of the new image. |
Height | 320 | 320 | this is the height in pixels of the new image. |
The co-ordinates for the crop are indicated in the image below:
This is the source image that will be used.
This image is 600 pixels wide by 450 pixels high.
The image below shows the created image of the source image which was cropped.