FixedResizeConstraint is one of the 2 filters available in Piczard that allow the automatic resize of images based on size constraints.In order to instantiate this filter, it is necessary to provide the size (width and height) of the image to generate.

The following code allows to instantiate a filter able to generate fixed size images (500 x 300 pixels):

Once the filter has been instantiated, it's ready to be used to process an imageFor example, by invoking the SaveProcessedImageToFileSystem method.The following code process the file "Source.jpg", and then save the result (an image having size 500x300 pixels) in a file with the name "Output.jpg":

With Piczard it's possible to apply more ImageProcessingFilters in sequence to an image.In order to do this, it is necessary to setup an instance of the ImageProcessingFilterCollection class.This class is a container where you can add an unlimited number of filters..

The filters are applied in sequence, during the image processing phase.

Please note that unit of measure different from Pixel (such as Inch or Mm), are relative to the image resolution (DPI).For example, an image having size 1 inch x 1 inch is equivalent to an image having size 300 x 300 pixels if the resolution is 300 DPI.While, if the resolution is 96 DPI, then the size 1 inch x 1 inch is equivalent to 96 x 96 pixels.

The ImageCrop filter supports only the Pixel graphic unit.However, through the static method ImageCrop.Calculate, it is possible to easily translate values expressed in different unit of measure. Example:ImageCrop pixelImageCrop = ImageCrop.Calculate(GfxUnit.Inch, new RectangleF(0F, 0F, 1.2F, 2.4F), 300F);