在网上看到一段代码,觉得有意思,就修改了下共享CSDN读友。
程序运行界面:
private void printDramC(Graphics g) { const int MID = 150; const int Top = 50; this.Text = "simple graphics snowman"; Font font = new Font("隶书",17); Pen blue = new Pen(Color.Blue); Pen yellow = new Pen(Color.Yellow); Pen white = new Pen(Color.White); Pen red = new Pen(Color.Red); Pen black = new Pen(Color.Black); Brush brWhite = white.Brush; Brush brBlack = black.Brush; Brush brRed = red.Brush; g.FillRectangle(brRed, 20, 30, 30, 120); g.FillRectangle(brRed, 250, 30, 30, 120); g.FillRectangle(brRed, 100, 0, 100, 25); StringFormat format = new StringFormat(); format.FormatFlags = StringFormatFlags.DirectionVertical; g.DrawString("三杯祝福歌", font, brBlack, 250, 30, format); g.DrawString("一曲迎春调", font, brBlack, 20, 30, format); g.DrawString("迎春祝福", font, brBlack, 100, 0); g.DrawRectangle(blue, 0, 175, 300, 50); //sky g.DrawEllipse(yellow, -40, -40, 80, 80); //sun g.FillEllipse(brWhite, MID - 20, Top, 40, 40); //head g.FillEllipse(brWhite, MID - 35, Top + 35, 70, 50); //top g.FillEllipse(brWhite, MID - 50, Top + 80, 100, 60); //bot g.FillEllipse(brBlack, MID - 10, Top + 10, 5, 5); //l.eye g.FillEllipse(brBlack, MID + 5, Top + 10, 5, 5);//r.eye g.DrawArc(black, MID - 10, Top + 20, 20, 10, -190, -160);//(: //arms g.DrawLine(black, MID - 25, Top + 60, Top - 50, MID + 40); g.DrawLine(black, MID + 25, Top + 60, MID + 55, Top + 60); g.DrawLine(black, MID - 20, Top + 5, MID + 20, Top + 5);//hat,brim,top g.FillRectangle(brBlack, MID - 15, Top - 20, 30, 25); }
相关视频
相关阅读 C#中正则表达式使用教程C#多线程的相关概念C#程序的访问修饰符介绍利用C#远程存取Access数据库C#多线程应用探讨全面剖析C#接口编程之定义接口全面剖析C#接口编程之接口概述C#开发的两个基本编程原则的深入讨论
热门文章 没有查询到任何记录。
最新文章
什么是.NET中的TDD?ASP.NET AJAX入门简介
WebMatrix入门教程VC++2008中如何调用GetOpenFileName打开文件PlaySound函数在VC++6.0中如何播放音乐及声请问VC++回调函数怎么用
人气排行 嵌入式实时操作系统VxWorks入门教程ArrayList 与 string、string[] 的转换C#遍历整个文件夹及子目录的文件代码WebMatrix入门教程asp.net判断文件或文件夹是否存在c#判断数据NULL值的方法vc++6.0怎么写Windows简单窗口代码.net解决数据导出excel时的格式问题
查看所有0条评论>>