I have an image of size w
by h
. In Java, I need to create an image that is size w
by h+20
where the top w
by 20 pixels
is white, and the rest of the image is the same as the original image.
Essentially I want to know how I can add 20 pixels of white to the top of an existing buffered image.
So it would be something like:
public static void main (String[] args) {
BufferedImage originalImage = [the original image with a specific file path];
...code to create a new image 20 pixels higher...
...code to paint originalImage 20 pixels down on the new image
...code to save the new image...
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…