• 个性二维码开源专题<替换元素点>


    基础方法:ChangeFillShape

    //修改填充形状
    ChangeFillShape(...)
            // 摘要:
            //     修改填充形状
            //
            // 参数:
            //   g:
            //     图形画板
            //
            //   Forebrush:
            //     填充色
            //
            //   rect:
            //     区域
            //
            //   en_fillshape:
            //     填充形状枚举
            //
            //   fillshpape:
            //     填充形状参数
            //
            //   Backbrush:
            //     背景色
            //
            //   isOutside:
            //     是否外修改
            public Graphics ChangeFillShape(Graphics g, Brush Forebrush, Rectangle rect, EN_FillShape en_fillshape, FillShape fillshpape, Brush Backbrush, bool isOutside = false);
    View Code

    主要更改,修改填充形状中的填充形状枚举参数。

    //填充形状枚举
    EN_FillShape
    
    //填充形状参数对象
    FillShape

    1、默认形状替换法

    扑克牌系列:

    黑桃:

    ChangeFillShape(g, Forebrush, rect, EN_FillShape.FillPeach, new FillShape(), Backbrush);

    红心:

    ChangeFillShape(g, Forebrush, rect, EN_FillShape.FillHeart, new FillShape(), Backbrush);

    梅花:

    ChangeFillShape(g, Forebrush, rect, EN_FillShape.FillPlumBlossom, new FillShape(), Backbrush);

    方形:

    ChangeFillShape(g, Forebrush, rect, EN_FillShape.FillDiamond, new FillShape(), Backbrush);

    多角形:

    ChangeFillShape(g, Forebrush, rect, EN_FillShape.FillPolygon, new FillShape() {  pointed=5}, Backbrush);

    多边形:

    ChangeFillShape(g, Forebrush, rect, EN_FillShape.FillRegularPolygon, new FillShape() {  side=5}, Backbrush);

    2、图片替换法:

    红砖(point1.jpg)

            private Image _imgBrick;
            public override void SetParam()
            {
                base.SetParam();
    
                string _imagePath1 = Environment.CurrentDirectory + @"QrCodeModelImagesSuperMariopoint1.jpg";
                _imgBrick = Image.FromFile(_imagePath1);
            }
    View Code
    ChangeFillShape(g, Forebrush, rect, EN_FillShape.DrawImage, new FillShape() { img = _imgBrick }, Backbrush);

    个性二维码开源专题<替换元素点>,在此介绍完毕了,谢谢大家的观看与支持。

     以下是开源地址,国外github,国内oschina.net

    oschina.net:

    http://git.oschina.net/cheng5x/Yc.QrCode

    github:

    https://github.com/cheng5x/YcQrCode

    官方网站:
    http://original-ad.com

    码晒客讨论QQ群:
    28629273

  • 相关阅读:
    快捷JS PHP
    css userAgent (简易浏览器区分) PHP
    http://fw.qq.com/ipaddress PHP
    JS竖排文字 PHP
    奇怪的body PHP
    使用36进制,无损压缩GUID到26位 PHP
    链接<a>执行JS PHP
    纯JS省市区三级联动 PHP
    Table 样式 PHP
    Exceeded storage allocation. The server response was: 4.3.1 Message size exceeds fixed maximum message size
  • 原文地址:https://www.cnblogs.com/cheng5x/p/3778120.html
Copyright © 2020-2023  润新知