jimmygyuma Posted May 4, 2007 Share Posted May 4, 2007 I would sure like to know how you do the diamond gradient. The best I've been able to do is: public void fillStarDiagGrad(Bitmap src, Color c1, Color c2) { int w = src.Width; int h = src.Height; Rectangle rect = new Rectangle(0, 0, w, h); GraphicsPath path = new GraphicsPath(); path.AddRectangle(rect); PathGradientBrush brush = new PathGradientBrush(path); brush.CenterColor = c1; Color[] surroundColors = new Color[] { c2 }; brush.SurroundColors = surroundColors; Graphics g = Graphics.FromImage(src); g.FillPath(brush, path); } which creates a diamond with the points pointing toward the corners of the rectangle, which is fine, but I also want a diamond with the points pointing vertically and diagonally, regardless of the rectangle. (A 90 degree diamond which I could point in any direction would be even nicer.) Could anyone point me in the right direction? Quote Link to comment Share on other sites More sharing options...
Rick Brewster Posted May 4, 2007 Share Posted May 4, 2007 Paint.NET does not use GDI+ (aka System.Drawing.*) for its gradients. It renders all the pixels using custom code in the GradientRenderers class. Quote The Paint.NET Blog: https://blog.getpaint.net/ Donations are always appreciated! https://www.getpaint.net/donate.html Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.