MattePainter matte = new MattePainter(new Color(21, 21, 71));If you want to take Painters for a spin pull down SwingX from SwingLabs. For more info on Nimbus check out
PinstripePainter stripes = new PinstripePainter();
stripes.setPaint(new Color(255, 255, 255, 15));
stripes.setSpacing(4.0);
stripes.setAngle(.25);
GlossPainter gloss = new GlossPainter();
TextPainter text = new TextPainter();
text.setFont(new Font("Informal Roman", Font.BOLD, 36));
text.setText("Aloha!");
text.setPaint(new Color(255,255,230));
text.setAntialiasing(RenderingHints.VALUE_ANTIALIAS_ON);
text.setLocation(new Point2D.Double(0.5, 0.5));
var lightBorderColor = Color.FromArgb(102, 102, 200);I also included support for manipulation of painters in the designer. For multi-state widgets like buttons a painter is provided for each state (ex. normal, pressed and hover.) Examples of widgets skinned with this library are pictured below. The source and binaries are attached. This project requires Visual C# or VisualStudio 2008. The library has no dependencies. TODOs: - Add a glass effect - Add a shadow effect - Add support for autosizing of labels (currently the autosizing doesn't work because of antialiasing ) Let me know if you have any questions or comments. IkayzoWinFormsLibrary.zip
var darkBorderColor = Color.FromArgb(60, 60, 255);
button.Painter = new Painter {
GradientFill = new GradientFill {
ColorA = Color.FromArgb(192, 192, 255),
ColorB = Color.Navy
},
MultiBorder = new MultiBorder {
OuterBorderSize = new Padding(1),
TopOuterColor = lightBorderColor,
LeftOuterColor = lightBorderColor,
BottomOuterColor = darkBorderColor,
RightOuterColor = darkBorderColor
},
ForeColor = Color.FromArgb(255, 255, 230)
};
© 2024 Created by Daniel Leuck. Powered by
You need to be a member of TechHui to add comments!
Join TechHui