Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Convert Shape object to Image object in Java

Tags:

java

image

shapes

How do I convert a Shape object like Rectangle2D.Double to an Image object?

This way I can use a Shape object for a mousecursor replacement.

like image 572
Jesse Avatar asked Jan 23 '26 08:01

Jesse


1 Answers

Do draw(shape) in a BufferedImage, as shown here.

like image 69
trashgod Avatar answered Jan 25 '26 21:01

trashgod



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!