0

How can I set a quite large drag icon made by transparent dragging component image. So the user sees what has selected for dragging while dragging.

It'd better that the image has a graded transparent level so the bottom right of the component image will be 99% transparent and the top left of the componenet image will have 50% transparency. What I need is generating the image and converting it to an ImageIcon.

The component can be any thing. Even a complex one. For example a JPanel with some other components inside.

puk
  • 193
  • 2
  • 13
  • Use the components printAll method to pant the component to a BufferedImage and apply a alpha gradient mask to it...Masking demonstrate [here](http://stackoverflow.com/questions/14225518/tinting-image-in-java-improvement/14225857#14225857) and [here](http://stackoverflow.com/questions/20556594/how-to-overlap-java-graphics-and-an-image-and-make-it-look-nice/20557029#20557029) – MadProgrammer Dec 29 '13 at 23:11
  • Can you write a sample code please? for an arbitrary component. I have never used such these features in Java. – puk Dec 29 '13 at 23:14
  • And painting a component to a BuffereImage [here](http://stackoverflow.com/questions/17690275/exporting-a-jpanel-to-an-image/17690351#17690351) – MadProgrammer Dec 29 '13 at 23:17

0 Answers0