With Java's graphics shape drawing operations, is there an easy way to give the shapes transparency gradients and blurry edges?

StackOverflow https://stackoverflow.com/questions/19497526

문제

What I would like is to give circles a fill color with a gradient that starts from the middle and then as it moves out to the edges becomes progressively more transparent, giving a blur effect. What is the simplest way of doing this?

도움이 되었습니까?

해결책

Try setting an appropiately defined java.awt.RadialGradientPaint (using Colors with alpha), then render your circles using that. You may need to translate the graphics coordinate system to get the gradient centered in the circle. (http://docs.oracle.com/javase/7/docs/api/java/awt/RadialGradientPaint.html)

Or just make an image in a graphics program and simply draw the image.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top