首页 > 代码库 > 个性二维码开源专题<液化/圆角/效果>
个性二维码开源专题<液化/圆角/效果>
基础方法:
ChangeFillShape
//修改填充形状ChangeFillShape(...)
View Code
//液化方法InkPaint(...)
View Code
//圆角样式 for (int i = 0; i < matrix.Length; i++) { for (int j = 0; j < matrix.Length; j++) { rect = new Rectangle((j + this.SpacingW) * QrCodeEncoder.QRCodeScale, (i + this.SpacingH) * QrCodeEncoder.QRCodeScale, QrCodeEncoder.QRCodeScale, QrCodeEncoder.QRCodeScale); if (matrix[j][i]) { ChangeFillShape(g, new SolidBrush(Color.Blue), rect, EN_FillShape.FillRoundRectangle, new FillShape() { radius = 5, roundStyle = RoundStyle.All }, Backbrush); } else { ChangeFillShape(g, Backbrush, rect, EN_FillShape.FillRectangle, new FillShape(), Backbrush); } } }
//修改radius 值
ChangeFillShape(g, new SolidBrush(Color.Blue), rect, EN_FillShape.FillRoundRectangle, new FillShape() { radius = 50, roundStyle = RoundStyle.All }, Backbrush);
//液化样式 for (int i = 0; i < matrix.Length; i++) { for (int j = 0; j < matrix.Length; j++) { rect = new Rectangle((j + this.SpacingW) * QrCodeEncoder.QRCodeScale, (i + this.SpacingH) * QrCodeEncoder.QRCodeScale, QrCodeEncoder.QRCodeScale, QrCodeEncoder.QRCodeScale); if (matrix[j][i]) { //ChangeFillShape(g, Forebrush, rect, EN_FillShape.FillRectangle, new FillShape(), Forebrush); FillShape _fillShape = new FillShape(); _fillShape = InkPaint(matrix, i, j, rect, 100, true); ChangeFillShape(g, Forebrush, rect, EN_FillShape.FillRoundRectangle, _fillShape, Backbrush); } else { ChangeFillShape(g, Backbrush, rect, EN_FillShape.FillRectangle, new FillShape(), Backbrush); //FillShape _fillShape = new FillShape(); //_fillShape = InkPaint(matrix, i, j, rect, 100, false); //ChangeFillShape(g, Backbrush, rect, EN_FillShape.FillRoundRectangle, _fillShape, Forebrush);//注意:液化背景色传入填充色ForeBrush } } }
for (int i = 0; i < matrix.Length; i++) { for (int j = 0; j < matrix.Length; j++) { rect = new Rectangle((j + this.SpacingW) * QrCodeEncoder.QRCodeScale, (i + this.SpacingH) * QrCodeEncoder.QRCodeScale, QrCodeEncoder.QRCodeScale, QrCodeEncoder.QRCodeScale); if (matrix[j][i]) { //ChangeFillShape(g, Forebrush, rect, EN_FillShape.FillRectangle, new FillShape(), Forebrush); FillShape _fillShape = new FillShape(); _fillShape = InkPaint(matrix, i, j, rect, 100, true); ChangeFillShape(g, Forebrush, rect, EN_FillShape.FillRoundRectangle, _fillShape, Backbrush); } else { //ChangeFillShape(g, Backbrush, rect, EN_FillShape.FillRectangle, new FillShape(), Backbrush); FillShape _fillShape = new FillShape(); _fillShape = InkPaint(matrix, i, j, rect, 100, false); ChangeFillShape(g, Backbrush, rect, EN_FillShape.FillRoundRectangle, _fillShape, Forebrush);//注意:液化背景色传入填充色ForeBrush } } }
个性二维码开源专题<液化/圆角/效果>,在此介绍完毕了,谢谢大家的观看与支持。
以下是开源地址,国外github,国内oschina.net
oschina.net:
http://git.oschina.net/cheng5x/Yc.QrCode
github:
https://github.com/cheng5x/YcQrCode
官方网站:
http://original-ad.com
码晒客讨论QQ群:
28629273
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。