Is there any method that shows if the image is in landscape orientation or not?
I have a file and I create aBufferedImage
, but don't know what's the method for fin开发者_Go百科ding the orientation.There are not method but the easiest way:
public boolean isLandscape(BufferedImage image){
return image.getWidth() > image.getHeight();
}
You could put this method to some Utils class.
try this ....
if (image.getIconWidth() > image.getIconHeight())
{ result = 0;
} else {
result = 1;
}
What about:
return (bi.getHeight () < bi.getWidth ());
精彩评论