Printer Object
 
Syntax
 
Result = Printer.ResamplePicture(SourceFile, DestFile, PixelSize[, JPEGQuality][, UseAlphaResampling][, ShrinkOnly])
 
Description
Loads the Sourcefile into memory and resamples the image to the desired PixelSize and finally, saves the resized and resampled image to DestFile.
 
If the resampling action was successfull, the function returns True.
 
NOTE: this function works stand-alone and does NOT require a Printer.Init instruction
 
Parameter
Description
SourceFile
The full path and filename of the image to be resampled
DestFile
The full path and filename of the new resampled image.
Warning: if the file exists, it will be overwritten!
PixelSize
The size of the output file. The function uses the maximum x/y size of the image for scaling. So, if the image height is larger than the image width, the height will be used for calculating the scaling factor.
JPEGQuality
Optional. When saving the output file as .JPG, the quality of the compressed picture can be altered.
Valid range is between 10 and 100. Default value: 90.
UseAlphaResampling
Optional, for use with images that support alpha blending. Default value: True.
ShrinkOnly
Optional, if True, resampling will only take place if the original image is larger than the destination. If False, the image will be resampled to a larger size.
Default value: False.
See Also
Example
 
Sub Main
 
Dim SF As String, DF As String
 
SF = "C:\test.jpg"
DF = "C:\test_resized,jpg"
 
Printer.ReSamplePicture SF, DF, 150
 
 
End Sub