CodeCarvings Piczard V1.2 Help
Automatic Image Resize
See Also Send Feedback
Piczard Fundamentals - Core > Built-in Filters > Resize An Image > Automatic Image Resize

Glossary Item Box


  1. Scaled Resize Constraint
  2. Fixed Resize Constraint



Please see the Example A.202 - "Resize an image / Automatic".

Piczard allows to "automatically" resize an image by using one of the two filters that inherit from ResizeConstraint:



1. Scaled resize constraint

This Resize Constraint creates images of variable size.
The source image is proportionally scaled so it can be entirely contained within a fixed size rectangle.


If you want to obtain an image with a fixed width and a variable height, then you can set a very high value for MaxSize.Height
(obviously the same technique can be used to get an image with a fixed height and a variable width).

The following example allows to generate an image with fixed width (150 pixels) and variable height:

Copy Code
ScaledResizeConstraint.GetMaxWidth(150).SaveProcessedImageToFileSystem("Source.jpg", "Output.jpg");

Figure 4: Image Scaled to a Fixed Width.



2. Fixed resize constraint

This Resize Constraint always creates images of fixed size.


See Also

Piczard Fundamentals - Core
Manual Image Resize

©2013 Sergio Turolla. All Rights Reserved.