AspJpeg 1.1+ is also capable of cutting off edges from, or cropping, the resultant thumbnails
via the method Crop(x0, y0, x1, y1). The size of the cropped image is
specified by the coordinates
of the upper-left
and lower-right corners within the resultant thumbnail, not the original large image.
If one or more coordinates passeed to the Crop method are outside the coordinate space of the image,
this will actually expand the "canvas" around the image.
This is useful, for example, if you need to create margins around the image. The following
code creates a 10-pixel margin around an image:
jpeg.Crop -10, -10, jpeg.Width + 10, jpeg.Height + 10
IMPORTANT: Before version 1.7, the color of the margins created by "negative" cropping was always white.
Starting with version 1.7, it is determined by the color specified via Canvas.Brush.Color, and is black
by default. To create a white 10-pixel margin with version 1.7+, the following code should be used:
jpeg.Canvas.Brush.Color = &HFFFFFF
jpeg.Crop -10, -10, jpeg.Width + 10, jpeg.Height + 10