arrow2 软件系统 arrow2 编程技术
利用C#制作公章
C#,制作公章
2007-10-08 15:23:43  

字体         收藏 推荐 打印 关闭

 


代码:
private void button1_Click(object sender, System.EventArgs e)
  {
   Graphics g = this.CreateGraphics();
   g.Clear(Color.White);
   //g.InterpolationMode = InterpolationMode.HighQualityBicubic;
   g.CompositingQuality = CompositingQuality.HighQuality;
   g.SmoothingMode = SmoothingMode.HighQuality;
           
   int radius = 200;
   CircularTextualLayout ctl = new CircularTextualLayout();
   ctl.Radius = radius;
   Point location = new Point(50, 20);
   //ctl.CenterPoint = new Point(location.X + radius, location.Y + radius);
   ctl.TextDrawing = "方正姚体方正姚体方正姚体方正姚体";


   float arcAngle = 270;
   ctl.ArcAngle = arcAngle;
   ctl.AngleStart = -arcAngle/2 + arcAngle/2/ctl.TextDrawing.Length;
   ctl.TextFontInner = new Font("方正姚体", radius/3.2f);
   ctl.RatioX = 0.6f;
   ctl.BorderWidth = (int)(ctl.Radius / 40);
   //ctl.IsBold = false;
   ctl.Location = location;
   ctl.WordsColor = Color.FromArgb(250, Color.Red);
   ctl.BorderColor = Color.FromArgb(250, Color.Red);
   ctl.RectColor = Color.FromArgb(250, Color.Red);
   ctl.Draw(g);


   g.Dispose();
  }


公章样式的水印图片(截图):


 



  private void button2_Click(object sender, System.EventArgs e)
  {
   Graphics g = this.CreateGraphics();
   g.Clear(Color.White);
   //g.DrawImage(Image.FromFile(@"F:\imgs\girl\227.jpg"), 0, 0);
   g.DrawImage(Image.FromFile(@"D:\JohnsunTest\aa\05290_b11.jpg"), 0, 0);
   //g.InterpolationMode = InterpolationMode.HighQualityBicubic;
   g.CompositingQuality = CompositingQuality.HighQuality;
   g.SmoothingMode = SmoothingMode.HighQuality;
           
   int radius = 100;
   int offset = 1;
   CircularTextualLayout ctl = new CircularTextualLayout();
   ctl.Radius = radius;
   Point location = new Point(500, 100);
   //ctl.CenterPoint = new Point(location.X + radius, location.Y + radius);
   ctl.TextDrawing = "公章样式之水印图片制作";


   float arcAngle = 270;
   //ctl.AngleStart = -105+ 210/ctl.TextDrawing.Length/2;
   ctl.ArcAngle = arcAngle;
   //ctl.AngleStart = (arcAngle/2) * ( - 1 + 1/ctl.TextDrawing.Length);
   ctl.AngleStart = -arcAngle/2 + arcAngle/2/ctl.TextDrawing.Length;
   //ctl.TextFontInner = new Font("方正小篆体", 56f);
   ctl.TextFontInner = new Font("方正姚体", radius/3.2f);
   ctl.RatioX = 0.6f;
   ctl.BorderWidth = (int)(ctl.Radius / 40);
   //ctl.IsBold = false;
   ctl.Location = location;
   ctl.WordsColor = Color.FromArgb(160, Color.Black);
   ctl.BorderColor = Color.FromArgb(160, Color.Black);
   ctl.RectColor = Color.FromArgb(160, Color.Black);
   ctl.Draw(g);


   location.Offset(-offset*2, -offset*2);
   ctl.Location = location;
   ctl.WordsColor = Color.FromArgb(160, Color.White);
   ctl.BorderColor = Color.FromArgb(60, Color.White);
   ctl.RectColor = Color.FromArgb(160, Color.White);
   ctl.Draw(g);


   g.Dispose();
  }


 


来自:不详   作者: 未知   责任编辑:admin | 返回顶部


用户评论
文章分类


名称 作者 内容 论坛

关键字
C#,制作公章

google中搜索
相关文章
  · C# 打造个性 ...
  · C#遍历菜单并 ...
  · C#实现回车自 ...
  · 用C#轻松在DOT ...
  · C#的图形绘制 ...
  · C#制作图像旋 ...
  · 一段用C#生成 ...
  · C#生成中文汉 ...
  · C#下的实现在 ...
  · 在C#的WinForm ...
  · 用C# 编写完全 ...

最新发表
  ·  C# 打造个性浏览器
  ·  域名解析操作说明
  ·  W2K下安装MYSQL 4.0.21
  ·  Asp.net中执行Url重写
  ·  第三方Web Html Editor的使用
  ·  Iframe跨域问题.
  ·  垃圾邮件评判优化
  ·  如何对电子商务系统进行需求分析
  ·  IPS支付说明
  ·  谈谈PHP文章系统和SEO的关系