JpegImage

The JpegImage method writes the whole image or its part to JPEG format.

JpegImage iCompression, iProgressive, sFileName [,nXStart] [,nYStart] [,Width] [,Height]

Parameters

iCompression
Specifies the coefficient of compression. Should be from 1 to 100. The recommended value is 90.

iProgressive
Specifies whether JPEG file will be multi-scan (progressive). If this parameter is zero, JPEG file will not be progressive. If the parameter is 1, the JPEG will be progressive.

sFileName
String specifying the name of the file to write to. If sFileName is a zero length string, the result JPEG image will be produces as SAFEARRAY return value. You can use this for generation of images with ASP and sending them to client instead of writing to file.

nXStart
Specifies the x-coordinate of the first base corner of the bounding rectangle

nYStart
Specifies the y-coordinate of the first base corner of the bounding rectangle

Width
Specifies the width of image bounding rectangle

Height
Specifies the height of image bounding rectangle

Return Value

This method returns binary JPEG image, if sFileName parameter is zero length string.

Remarks

For generation of images with ASP on the fly and sending them to client use BinaryWrite method of Response object.
If you have not specified the image sizes, the whole image will be compressed.