This may be a weird question, but interesting for me. When we create an image using java, we use:
BufferedImage screencapture = new Robot().createScreenCapture(new Rectangle(Toolkit.getDefaultToolkit().getScreenSize()) );
But it uses new Rectangle
as the image shape, Is there any way to change the image shape? I didn't see any option for that in my eclipse editor.
If there is, please give me an example.
I don't see any possible way to create different shaped image
Here is a list of the available classes in awt(where we get the image shape). In this list, there aren't any other available shapes.
The method
createScreenCapture()
takes ajava.awt.Rectangle
as its sole parameter - so we can only use a Rectangle. There are no overloads to choose from either.Images themselves are also a rectangle, the computer is unlikely to be able to read any other shape (if it's even possible to create a different shaped image).