Purpose: Stretch or shrink the size of an image file.
Format: SCALE Input File h < v > < Output File>
Notes: Parameter h contains the scaling multiplier for the horizontal dimension of the image. If the value specified is more than 1.0 then the image is magnified. A value that is less than 1.0 produces an image that is minified. The v parameter is optional and used to provide a separate vertical scaling factor to the image file. If this parameter is omitted then the vertical scaling factor will be the same as specified in the h parameter. If the <Output File> is specified then the output is written to this file instead of replacing the original file
Example:
# Generate an image and
overlay a 1/4 size
# replica on to the
full size image file.
image_width = 640
image_height = 480
image_type = 3
outfile example.img
pixel_tot = 255 * 1/(image_width
* image_height)
process begin
out = (ypos * image_width
+ xpos) * pixel_tot
process end
# Copy the image
infile_a example.img
outfile shrunk.img
process begin
out = ina
process end
# Shrink image to 1/4 of original size.
scale shrunk.img .25
# Paste it back on near the upper left corner
paste shrunk.img example.img 30 45
# Stretch the small image and paste also
scale shrunk.img 1.5
2.5
paste shrunk.img example.img
300 200
# Create a viewing picture
infile_a example.img
bmp
window = 256
level = 128
process begin
out = ina
process end
delete example.img
delete shrunk.img
exit