You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Exporting profile icons in a circular shape is a common requirement. However, I couldn't find an option to crop images into a circular shape using the Image class.
I tried several methods, including clip paths and Graphics2D objects. The challenge is that I need the cropped images inside a TableCell along with text. One approach that worked involves converting the image to BufferedImage, using a Graphics object, and then converting it back to byte[] to create a new Image instance. However, this process significantly increases the PDF generation time, taking minutes for small data sets and hours for larger ones.
Please enable an optimized way to draw images in circular shapes, or direct me to the relevant code if this functionality is already available.
Thank you
The text was updated successfully, but these errors were encountered:
I do agree that this would be a nice feature to have. However, I was able to get a proof of concept for another method for creating circular shaped images, which is hopefully less taxing. I created a mask image, which was of a circular shape, and then I applied that overtop of my original image. This allows for a singular mask to apply to multiple images. While my proof of concept had poorly defined borders around the mask, I believe with a bit of effort, you could create a well defined border.
Exporting profile icons in a circular shape is a common requirement. However, I couldn't find an option to crop images into a circular shape using the Image class.
I tried several methods, including clip paths and Graphics2D objects. The challenge is that I need the cropped images inside a TableCell along with text. One approach that worked involves converting the image to BufferedImage, using a Graphics object, and then converting it back to byte[] to create a new Image instance. However, this process significantly increases the PDF generation time, taking minutes for small data sets and hours for larger ones.
Please enable an optimized way to draw images in circular shapes, or direct me to the relevant code if this functionality is already available.
Thank you
The text was updated successfully, but these errors were encountered: