Crops the image using specified rectangle (which is not obligatory totally inside the bitmap).
Namespace:
Aurigma.GraphicsMill
Assembly:
Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)
Public Sub Crop ( _
x As Integer, _
y As Integer, _
width As Integer, _
height As Integer, _
backgroundColor As Color _
)
Type: System.Int32
X-coordinate of the cropping rectangle.Type: System.Int32
Y-coordinate of the cropping rectangle.Type: System.Int32
Width of the cropping rectangle.Type: System.Int32
Height of the cropping rectangle.Dim offset As Integer = 20
'Crop in
bitmap.Transforms.Crop(offset, offset, _
bitmap.Width - 2 * offset, bitmap.Height - 2 * offset)
'Add vignette
bitmap.Transforms.Buttonize(50, Aurigma.GraphicsMill.Transforms.FadeType.Nonlinear, _
Aurigma.GraphicsMill.Transforms.Direction.UpLeft, _
Aurigma.GraphicsMill.RgbColor.Black, _
Aurigma.GraphicsMill.RgbColor.Black)
'Crop out
bitmap.Transforms.Crop(-offset, -offset, _
bitmap.Width + 2 * offset, bitmap.Height + 2 * offset, _
Aurigma.GraphicsMill.RgbColor.Black)
const int offset = 20;
//Crop in
bitmap.Transforms.Crop(offset, offset,
bitmap.Width - 2 * offset, bitmap.Height - 2 * offset);
//Add vignette
bitmap.Transforms.Buttonize(50, Aurigma.GraphicsMill.Transforms.FadeType.Nonlinear,
Aurigma.GraphicsMill.Transforms.Direction.UpLeft,
Aurigma.GraphicsMill.RgbColor.Black,
Aurigma.GraphicsMill.RgbColor.Black);
//Crop out
bitmap.Transforms.Crop(-offset, -offset,
bitmap.Width + 2 * offset, bitmap.Height + 2 * offset,
Aurigma.GraphicsMill.RgbColor.Black);