Use SaveThumbnailToJPEG to save a thumbnail image as jpeg-file.
This method gives the possibility to save thumbnail images as jpeg-file. It is possible to set the size of the picture with the parameters Width and Height. Use Compression to set the compression quality of the JPEG image when writing out a jpeg image. Higher compression results in a poorer picture quality, but a smaller file size. The higher the Quality value (up to a maximum of 100), the better the image quality, but the larger the file size. The lower the Quality value (to a minimum of 1), the smaller the resulting file size, but at the expense of picture quality.
This example saves a thumbnail image as jpeg-file with a size of 150*150 pixel and a quality value of 50.