利用C#制作公章
来源:互联网 发布:普陀区u盘数据恢复 编辑:程序博客网 时间:2024/04/28 01:20
先看一下效果图:
代码:
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();
}
Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId=622836
- 利用C#制作公章
- 利用C#制作公章
- 利用C#制作公章
- 利用C#制作公章(续)
- C#中制作公司公章
- 用word制作电子公章
- WPF公章制作之2
- 在WPF中制作正圆形公章
- 学习日记-Photoshop制作逼真公章
- 【Java】如何优雅的用代码制作企业公章
- C#个性印章及公章的画法及实现
- 利用c#制作简单的留言板(1)
- 利用c#制作简单的留言板(2)
- 利用c#制作简单的留言板(3)
- 利用c#制作简单的留言板(4)
- 利用C#制作简单的留言板
- 利用c#制作简单的留言板 (4)
- 利用c#制作简单的留言板 (2)
- 一个用于J2EE应用程序的Backbase Ajax前端
- 用css实现孤形表格效果
- Symbian下用C++实现网页浏览的代码
- ASCII 字符表
- [翻译].NET委托:一个C#睡前故事 [推荐]
- 利用C#制作公章
- C#中编写多线程(1)——起步
- 一个寻找adventnet破解版序列号的好网址
- 数制转化
- c#操作文本文件
- Eclipse Platform 3.0 运行环境设置
- GOOGLE登陆火星
- C#的多线程(2)——机制探索
- 在C#中使用异步Socket编程实现TCP网络服务