0

Currently, the closest drawImage() has the following signature:

public abstract boolean drawImage(java.awt.Image img, int dx1,int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, java.awt.image.ImageObserver observe);

This method draws a rectangular subset of an image onto a Graphics context. However, I want to only draw a circular section of an image. How do I do this?

Thanks

Alan Tao
  • 1
  • 1
  • 1
    Why not simply mask everything but the circular disk? – Hovercraft Full Of Eels Jun 26 '22 at 21:58
  • There is always the option to use an image that uses solid color in one area but transparent pixels around that, like some of the images seen [here](https://stackoverflow.com/a/19209651/418556). The first two groups of images (geometric shapes and chess pieces) both use this technique. If the images will only ever be used like this and are supplied with the program, it makes sense to do this once only. – Andrew Thompson Jun 27 '22 at 03:33

0 Answers0