Free Support Forum -

Can we make a rectangle with rounded corner?


I have drawn an image in graphics and wanted to keep it in a rectangle with rounded corner. Do I have any options available for this?

URL url = new URL(appModel.getScreenshots()[i-1]);
            InputStream inputStream = url.openStream();
            //FileInputStream inputStream = new FileInputStream(dataDir + playstoreBody.getNewImageName());
            Layer newLayer = new Layer(inputStream);
            //Layer newLayer = new Layer(is);
            Graphics graphics = new Graphics(scrshotLayer);
            graphics.drawImage(newLayer, new Rectangle(new Point(), new Size(Math.abs(scrshotLayer.getWidth()), Math.abs(scrshotLayer.getHeight()))));


Can you please share the requirements in the form of sample image that what you are trying to achieve so that we may try to help you further.

Screenshot (14).png (266.2 KB)
newImage8.jpg (490.9 KB)
AS you can see the logo of both image in one it is rounded corner but when i am replacing with my logo it got in a rectangle with sharp edges. is there any way to make it round?


Can you please share the working sample code reproducing the issue so that we may investigate it further on our end.