Free Support Forum - aspose.com

Can we make a rectangle with rounded corner?

Hi,

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.clear(Color.getEmpty());
            graphics.drawImage(newLayer, new Rectangle(new Point(), new Size(Math.abs(scrshotLayer.getWidth()), Math.abs(scrshotLayer.getHeight()))));

@mail9deep

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.

@mudassir.fayyaz
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?

@mail9deep

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