wonder if there is property of
Image.createImage(width, height)
then why doesn't it stretch it to the value I provide?
Parameters in this method have nothing to do with stretching, see API javadocs:
public static Image createImage(int width, int height) Creates a new, mutable image for off-screen drawing. Every pixel within the newly created image is white. The width and height of the image must both be greater than zero. Parameters: width - the width of the new image, in pixels height - the height of the new image, in pixels
Image
class (API javadocs) has two more createImage
methods that use parameters called "width" and "height" - one with six, another with four arguments but none of these has anything to do with stretching.
In
createImage
with six arguments, width and height specify size of the region to be copied (without stretching) from source image.In method with four arguments, width and height specify how to interpret source ARGB array, without these it would be impossible to find out if, say, array of
12
values represents3x4
image or4x3
. Again, this has nothing to do with stretching.