当前位置: 首页 > news >正文

佛山做网站设计制作价格有做电动车修车的网站吗

佛山做网站设计制作价格,有做电动车修车的网站吗,怎么在虚拟空间做两个网站,龙岩网站报价在.NET中#xff0c;画图主要是通过Graphics类实现的#xff0c;这个类主要通过两类方法完成画图#xff0c;一类是DrawXXX#xff0c;画各种线条图形#xff1b;另一类是FillXXX,用各种形状#xff0c;填充各种图形。Graphics是画板#xff0c;Draw各个方法是各种盏笔画图主要是通过Graphics类实现的这个类主要通过两类方法完成画图一类是DrawXXX画各种线条图形另一类是FillXXX,用各种形状填充各种图形。Graphics是画板Draw各个方法是各种盏笔不过在调用Draw方法时参数需要一个Pen对象)Fill的各个方法就是种种刷子确实Fill的方法参数也需要一个Brush对象。首先要熟悉各个Draw和Fill方法以及他们的参数那么剩下的事就是对坐票了画什么在那里画怎么用Draw和Fill了。下面是在Form上画了一个小票然后调用打印组件在虚拟打印机里打印出来的效果。using QRCoder; using System.Drawing; using System.Drawing.Drawing2D; using System.Drawing.Imaging;namespace WinFormsDemo12 {public partial class Form1 : Form{public Form1(){InitializeComponent();}void Draw(Graphics graphics){var y 15;using var logo new Bitmap(Directory.GetCurrentDirectory() /aeon.png);graphics.DrawImage(MakeGrayscale(logo), 60, y, 200, 80);graphics.DrawLine(new Pen(Color.Black, 2), 10, y 80, 310, y);graphics.DrawLine(new Pen(Color.Black, 2), 10, y 4, 310, y);var font new Font(黑体, 10);var brush new SolidBrush(Color.Black);graphics.DrawString(分店012, font, brush, 10, y 1);graphics.DrawString(店员张三, font, brush, 160, y);graphics.DrawString($时间{DateTime.Now.ToString(yyyy-MM-dd HH:mm:ss)}, font, brush, 10, y 20);var no 000000000001;graphics.DrawString($流水号{no}, font, brush, 10, y 20);graphics.DrawLine(new Pen(Color.Black, 2), 10, y 25, 310, y);graphics.DrawString(名称 数量 单价 金额, font, brush, 10, y 5);graphics.DrawString(西红柿 500g 26.00 15.00, font, brush, 10, y 20);graphics.DrawString(西葫芦 1000g 23.00 23.00, font, brush, 10, y 20);graphics.DrawString(茄子 500g 50.00 25.00, font, brush, 10, y 20);graphics.DrawString(豆角 500g 38.00 19.00, font, brush, 10, y 20);graphics.DrawLine(new Pen(Color.Black, 2), 10, y 20, 310, y);graphics.DrawLine(new Pen(Color.Black, 2), 10, y 4, 310, y);var sumfont new Font(黑体, 12);graphics.DrawString( 小计82, sumfont, brush, 10, y 5);var qrCodeAsBitmapByteArr PngByteQRCodeHelper.GetQRCode(no, QRCodeGenerator.ECCLevel.Q, 20, false);using var qrcode Image.FromStream(new MemoryStream(qrCodeAsBitmapByteArr));graphics.DrawImage(qrcode, 100, y 50, 120, 120);}public static Bitmap MakeGrayscale(Bitmap original){var newBitmap new Bitmap(original.Width, original.Height);var g Graphics.FromImage(newBitmap);var colorMatrix new System.Drawing.Imaging.ColorMatrix(new float[][]{new float[] {.3f, .3f, .3f, 0, 0},new float[] {.59f, .59f, .59f, 0, 0},new float[] {.11f, .11f, .11f, 0, 0},new float[] {0, 0, 0, 1, 0},new float[] {0, 0, 0, 0, 1}});var attributes new System.Drawing.Imaging.ImageAttributes();attributes.SetColorMatrix(colorMatrix);g.DrawImage(original, new Rectangle(0, 0, original.Width, original.Height), 0, 0, original.Width, original.Height, GraphicsUnit.Pixel, attributes);g.Dispose();return newBitmap;}   private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e){if (e.Graphics ! null){Draw(e.Graphics);}}private void button2_Click(object sender, EventArgs e){printDocument1.Print();}private void button1_Click(object sender, EventArgs e){var graphics this.CreateGraphics();Draw(graphics);}} }MakeGrayscale方法是把彩色logo转黑白的一个算法关注画图部分请忽略。Graphics实现了IDisposable用后请释放。窗体的浏览效果虚拟打印机输出的PDF效果图
http://www.pierceye.com/news/367183/

相关文章:

  • 上海网站建设,分类广告软件公司简介
  • 网站虚拟主机被国家禁止访问的网站怎么打开
  • wordpress手机加载不出来优化官网咨询
  • 平台网站建设预算表如何来做网站
  • 温州网站制作企业东莞网络推广公司电话
  • 网站建设的条件重庆那些网站
  • 伊犁网站制作大连甘井子区房价
  • 循环视频做网站背景win2012r2 建设网站
  • 建设网站制作汉狮团队义乌北苑编程网站开发公司
  • 网站开发公司会计处理滨州市住房和城乡建设局网站
  • 企业网站站内优化长尾关键词挖掘站长工具
  • 山东平台网站建设企业怎么做自己的品牌网站
  • 长沙seo网站排名杭州网站建设q479185700棒
  • 泰州网站建设搭建工程造价网
  • 网站流程优化c2c模式举例子
  • 帝国网站调用图片集网店平台有哪些
  • 做flash音乐网站的开题报告删除wordpress左上角
  • php网站开发学什么衡水大型网站建设
  • 广州网站开发软件平台wordpress 问号
  • 西安市建设干部学校网站厦门网站优化服务
  • 深圳市南山区住房和建设局官方网站如何把html网站改为asp网站
  • 网站建设有什么技术做dw网站图片怎么下载地址
  • 初中生如何做网站潍坊网站开发
  • 如何修改用织梦做的网站的模板价格对比网站开发
  • 单位建设网站的作用意义家在深圳坂田业主论坛
  • 网站什么时候备案好宜昌网站建设
  • 那个网站可以查询美做空基金竹中建设官方网站
  • 做直播网站找哪个网站网站平台推广方法
  • 查工程中标信息哪个网站成都网站建设 致尚
  • 做硅胶的网站wordpress googleapis