![](https://img-blog.csdnimg.cn/20190828191456848.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
GDI+
GreAmbWang
博客是我的笔记本,Blink是我的朋友圈,论坛是我的老师
展开
-
【GDI+】旋转文本
绘制Label上的文本内容,先获取一些参数Graphics g = this.CreateGraphics();//清除g.Clear(BackColor);//位置Point point = lbTest.Location;//文本string text = lbTest.Text;//字体Font font = lbTest.Font;//颜色Brush brush...原创 2019-08-06 19:48:02 · 1104 阅读 · 0 评论 -
【GDI+】根据Font测量字符串大小,宽度和高度,不是字符串长度(字符数量)
用Graphics中的MeasureString方法使用SizeF sizeF = g.MeasureString(text, font);原创 2019-08-09 16:02:11 · 1340 阅读 · 0 评论 -
【GDI+】绘制圆角矩形
获取圆角矩形的线private void DrawRoundRect(GraphicsPath gp, float X, float Y, float width, float height, float radius){ gp.AddLine(X + radius, Y, X + width - (radius * 2), Y); gp.AddArc(X + width ...原创 2019-08-09 16:36:33 · 1338 阅读 · 2 评论 -
【WinForm】下拉框ComboBox绘制颜色选项
效果:首先,需要将绘制模式设置为手动绘制,绑定绘制方法,添加颜色//设置手动绘制cmb.DrawMode = DrawMode.OwnerDrawFixed;cmb.DropDownStyle = ComboBoxStyle.DropDownList;cmb.DrawItem += cmb_DrawItem;cmb.Items.Add(Color.Red);cmb.Ite...原创 2019-06-21 23:04:08 · 5539 阅读 · 1 评论