如何在对象内添加颜色。 [英] How To Add Color Inside object.

查看:79
本文介绍了如何在对象内添加颜色。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Mypen创建了一个圆圈现在我想在其中添加颜色如何在其中添加颜色。

 System.Drawing.Pen myPen =  new  System.Drawing.Pen(System.Drawing.Color.Black); 
System.Drawing.Graphics formGraphics;
formGraphics = this .CreateGraphics();
formGraphics.DrawEllipse(myPen, new 矩形( 10 230 150 150 ));

解决方案

可能你打算用 FillEllipse

http://msdn.microsoft.com/en-us/library /system.drawing.graphics.fillellipse%28v=vs.110%29.aspx [ ^ ]。



-SA

I Have Made A Circle Using Mypen Now I Want To Add Color Inside It How To Add Color Inside It.

System.Drawing.Pen myPen = new System.Drawing.Pen(System.Drawing.Color.Black);
System.Drawing.Graphics formGraphics;
formGraphics = this.CreateGraphics();
formGraphics.DrawEllipse(myPen, new Rectangle(10, 230, 150, 150));

解决方案

Probably you meant to use FillEllipse:
http://msdn.microsoft.com/en-us/library/system.drawing.graphics.fillellipse%28v=vs.110%29.aspx[^].

—SA


这篇关于如何在对象内添加颜色。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆