学习型 ASP/PHP/ASP.NET 主机 30元/年全能 ASP/PHP/ASP.NET 主机,支持月付专业 MSSQL 数据库空间,支持月付专业 MySQL 数据库空间,支持月付
轻松建立自己的群组,招兵买马   
发新话题
打印

求助[图形]

求助[图形]

谁有手动绘制图形的小例子,能不能分享一个,在这里先谢过了!

TOP

//将Target对象外观改为圆形
   GraphicsPath gp = new GraphicsPath() ;
    gp.AddEllipse(0, 0, 25, 25) ;
    Region r = new Region(gp) ;
   PictureBox TmpSender = (PictureBox)sender ;
    TmpSender.Region  = r ;
主要是用GraphicsPath类,
纯属个人意见,仅供参考!

TOP

画一个矩形

Some sample Examples:

protected override void OnPaint(PaintEventArgs pe)

{

Graphics g = pe.Graphics ;

Rectangle rect = new Rectangle(50, 30, 100, 100);

LinearGradientBrush lBrush = new LinearGradientBrush(rect, Color.Red,Color.Yellow,

LinearGradientMode.BackwardDiagonal);

g.FillRectangle(lBrush, rect);

}

TOP

发新话题