四联光电智能照明论坛

标题: 绘图 [打印本页]

作者: admin    时间: 2018-6-15 14:20
标题: 绘图
c# 自动计算字符串的宽度 - 脸谱匠 - 博客园 https://www.cnblogs.com/icyJ/p/MeasureText.html
作者: admin    时间: 2018-6-15 14:20
C#Color对象的使用介绍及颜色对照表 - 杨奉武 - 博客园 https://www.cnblogs.com/yangfengwu/p/6135941.html
作者: admin    时间: 2018-6-18 22:25
C#图像处理(各种旋转、改变大小、柔化、锐化、雾化、底片、浮雕、黑白、滤镜效果) - CSDN博客 https://blog.csdn.net/shuliuzh/article/details/38553497
作者: admin    时间: 2018-6-19 10:08
C#中基于GDI+(Graphics)图像处理系列之高质量缩略图 - CSDN博客 https://blog.csdn.net/lhtzbj12/article/details/54099246
作者: admin    时间: 2019-1-28 15:36
C# WinForm窗体四周阴影效果 - 于大大大洋 - CSDN博客 https://blog.csdn.net/arrowzz/article/details/77899061
作者: admin    时间: 2019-1-28 15:37
绘制圆角矩形:
  1. public static void DrawRoundRectangle(Graphics g, Pen pen, Rectangle rect, int cornerRadius)
  2. {
  3.     using (GraphicsPath path = CreateRoundedRectanglePath(rect, cornerRadius))
  4.     {
  5.         g.DrawPath(pen, path);
  6.     }
  7. }
  8. public static void FillRoundRectangle(Graphics g, Brush brush, Rectangle rect, int cornerRadius)
  9. {
  10.     using (GraphicsPath path = CreateRoundedRectanglePath(rect, cornerRadius))
  11.     {
  12.         g.FillPath(brush, path);
  13.     }
  14. }
  15. internal static GraphicsPath CreateRoundedRectanglePath(Rectangle rect, int cornerRadius)
  16. {
  17.     GraphicsPath roundedRect = new GraphicsPath();
  18.     roundedRect.AddArc(rect.X, rect.Y, cornerRadius * 2, cornerRadius * 2, 180, 90);
  19.     roundedRect.AddLine(rect.X + cornerRadius, rect.Y, rect.Right - cornerRadius * 2, rect.Y);
  20.     roundedRect.AddArc(rect.X + rect.Width - cornerRadius * 2, rect.Y, cornerRadius * 2, cornerRadius * 2, 270, 90);
  21.     roundedRect.AddLine(rect.Right, rect.Y + cornerRadius * 2, rect.Right, rect.Y + rect.Height - cornerRadius * 2);
  22.     roundedRect.AddArc(rect.X + rect.Width - cornerRadius * 2, rect.Y + rect.Height - cornerRadius * 2, cornerRadius * 2, cornerRadius * 2, 0, 90);
  23.     roundedRect.AddLine(rect.Right - cornerRadius * 2, rect.Bottom, rect.X + cornerRadius * 2, rect.Bottom);
  24.     roundedRect.AddArc(rect.X, rect.Bottom - cornerRadius * 2, cornerRadius * 2, cornerRadius * 2, 90, 90);
  25.     roundedRect.AddLine(rect.X, rect.Bottom - cornerRadius * 2, rect.X, rect.Y + cornerRadius * 2);
  26.     roundedRect.CloseFigure();
  27.     return roundedRect;
  28. }
复制代码


作者: 风火石    时间: 2019-1-30 21:40
在VC中用GDI+绘制角度可变的颜色渐变效果 - 寒星轩 - CSDN博客 https://blog.csdn.net/starlee/article/details/557947
作者: admin    时间: 2019-9-12 16:56
C#设置图像透明度 - 百度文库 https://wenku.baidu.com/view/e03b740c581b6bd97f19ead2.html




欢迎光临 四联光电智能照明论坛 (http://5xhome.com/) Powered by Discuz! X3.2