c#画圆时怎样才能把圆心也画出来啊?代码怎么写?

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/06 02:12:54
c#画圆时怎样才能把圆心也画出来啊?代码怎么写?

c#画圆时怎样才能把圆心也画出来啊?代码怎么写?
c#画圆时怎样才能把圆心也画出来啊?代码怎么写?

c#画圆时怎样才能把圆心也画出来啊?代码怎么写?
public int CursorX,CursorY,r;
public Image theimage;
public Graphics ig,g;
private void Form1_Load(object sender, System.EventArgs e)
{
theimage=new Bitmap(this.pictureBox1.ClientRectangle.Width,this.pictureBox1.ClientRectangle.Height);
ig=Graphics.FromImage(theimage);
ig.InterpolationMode=System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
g=this.pictureBox1.CreateGraphics();
g.InterpolationMode=System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
}
private void pictureBox1_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
{
if(CursorMod==0)
{
CursorMod=1;
CursorX=e.X;
CursorY=e.Y;
}
else
{
CursorMod=0;
ig.DrawEllipse(new Pen(Color.Green,1),CursorX-r,CursorY-r,2*r,2*r);
pictureBox1.Image=theimage;
}
}
private void pictureBox1_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
{
if(CursorMod==1)
{
this.pictureBox1.Refresh();
r=Convert.ToInt32(Math.Sqrt(Math.Abs(e.X-CursorX)*Math.Abs(e.X-CursorX)+Math.Abs(e.Y-CursorY)*Math.Abs(e.Y-CursorY)));
g.DrawEllipse(new Pen(Color.Green,1),CursorX-r,CursorY-r,2*r,2*r);
}
else//CursorMod==0
{
this.pictureBox1.Refresh();
}
}

c#画圆时怎样才能把圆心也画出来啊?代码怎么写? 如何用C#画出五角星的图形,求代码 影子画,把图片也画出来! 流程图 我给一段代码,谁能帮我画出来流程图是c语言,有一段代码需要画出来流程图,自己不大熟练,画不好,谁可以帮我一下?我会把代码发过去的 , 高中物理 详解把受力分析图也画出来 把受力分析图也画出来 求解二十四题 把图也画出来 麻烦把图也给画出来吧, 如何用RGB三元色大小来计算亮度可以给c#的相关代码吗? C#类中的public和private区别我知道它们的定义,但打代码时,把它们互换看不出有什么变化,请高手举例说明……把它们互换也没有报错 C#三维坐标系在C#中怎么画三维坐标系啊,要左手坐标系,最好附上代码. 求10000以内最大的素数用C#写代码,拜托哪位高人帮帮忙啊~~~~! C#中的Console.Read()和Console.ReadLine()刚刚用C#写了一个顺序表,由于成员函数的实现有点长因此不再赘述而且代码也应该没什么问题,我就把出现问题的主函数贴在下面:public static void Main(){ S 数学把图像画出来 怎样把故事画出来 把三幅图分别画出来, c#还是很急~~但是没有分了`~~~帮帮忙把~! 计算器的取余运算代码是什么?~~~~ 谁能帮我详细解释一下这个用C#画图的代码是怎样画出来的?private void Form1_Paint(object sender,PaintEventArgs e){// 准备平行四边形Point[] sbx = new Point[]{new Point(100,50),new Point(400,50),new Point(350,200),new Point(