Results 1 to 3 of 3
Thread: Path Gradient Paint in Java 2D?
- 05-07-2010, 06:07 PM #1
Member
- Join Date
- May 2010
- Location
- northern california
- Posts
- 7
- Rep Power
- 0
Path Gradient Paint in Java 2D?
I have used PathGradientPaint in .NET and would like to find a way to replicate it in Java2D.
Specifically, I'm trying to replicate the gradual shading of the button at the URL below which is easy in .NET:
http://www.vgdotnet.com/articles/cal...gle_button.png
I have searched the web via Google to no avail. I have created semi-transparent inner rectangles and then blurred and alpha-composited them on top of the background but this is just not as effective. I also tried using RadialGradientPaint for the corners and GradientPaint for the straight sides, but it just didn't look very good.
I could write my own Paint and PaintContext to do this, but would prefer not to reinvent the wheel.
Thanks in advance,
RickLast edited by rtc1; 05-07-2010 at 07:30 PM. Reason: Added additional information
- 05-07-2010, 06:18 PM #2
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,400
- Blog Entries
- 7
- Rep Power
- 17
Does a GradientPaint object help you a bit?
kind regards,
Jos
- 05-07-2010, 06:24 PM #3
Member
- Join Date
- May 2010
- Location
- northern california
- Posts
- 7
- Rep Power
- 0
Jos, sorry, but not that I know of.
Neither does RadialGradientPaint. Here is a clock I coded recently in Java 2D that uses GradientPaint and RadialGradientPaint, so I do know about these classes.
http://sites.google.com/site/rickcre...lockMedium.png
If there is a clever way to use GradientPaint that I haven't thought of, let me know.
Thanks for your reply.
Rick
Similar Threads
-
Gradient of an image
By Sapan in forum Forum LobbyReplies: 1Last Post: 04-08-2011, 03:03 PM -
Java Paint Method?
By leapinlizard in forum Java 2DReplies: 2Last Post: 02-11-2010, 07:01 PM -
JComponent gradient background
By snipered in forum AWT / SwingReplies: 0Last Post: 12-30-2008, 12:38 AM -
CLabel Gradient Background
By Java Tip in forum SWTReplies: 0Last Post: 07-11-2008, 04:39 PM -
Color gradient
By Java Tip in forum java.awtReplies: 0Last Post: 06-21-2008, 08:50 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks