YcQrCode-master
所属分类:C#编程
开发工具:C#
文件大小:3841KB
下载次数:5
上传日期:2016-01-19 21:32:38
上 传 者:
Lyen
说明: 个性二维码模版制作底层
要求:
C#.net 4.0以上引入 lib\Yc.QrCodeLib.dll
永久开源,自主研发个性二维码模版。
(Personalized dimensional code templates make the underlying
Claim:
C# .net 4.0 more than the introduction of lib \ Yc.QrCodeLib.dll
Permanently open, independent research and personalized two-dimensional code templates.)
文件列表:
LICENSE (18040, 2014-06-06)
Yc.QrCode.Test (0, 2014-06-06)
Yc.QrCode.Test\IniHelper.cs (3771, 2014-06-06)
Yc.QrCode.Test\Program.cs (465, 2014-06-06)
Yc.QrCode.Test\Properties (0, 2014-06-06)
Yc.QrCode.Test\Properties\AssemblyInfo.cs (1396, 2014-06-06)
Yc.QrCode.Test\Properties\Resources.Designer.cs (2801, 2014-06-06)
Yc.QrCode.Test\Properties\Resources.resx (5837, 2014-06-06)
Yc.QrCode.Test\Properties\Settings.Designer.cs (1084, 2014-06-06)
Yc.QrCode.Test\Properties\Settings.settings (242, 2014-06-06)
Yc.QrCode.Test\QrCodeModel (0, 2014-06-06)
Yc.QrCode.Test\QrCodeModel\Images (0, 2014-06-06)
Yc.QrCode.Test\QrCodeModel\Images\Angry_Birds (0, 2014-06-06)
Yc.QrCode.Test\QrCodeModel\Images\Angry_Birds\agri1.png (6277, 2014-06-06)
Yc.QrCode.Test\QrCodeModel\Images\Angry_Birds\agri2.png (6972, 2014-06-06)
Yc.QrCode.Test\QrCodeModel\Images\Angry_Birds\agri3.png (8220, 2014-06-06)
Yc.QrCode.Test\QrCodeModel\Images\Angry_Birds\agri4.png (5147, 2014-06-06)
Yc.QrCode.Test\QrCodeModel\Images\Angry_Birds\agri5.png (5300, 2014-06-06)
Yc.QrCode.Test\QrCodeModel\Images\Angry_Birds\bg1.png (5676, 2014-06-06)
Yc.QrCode.Test\QrCodeModel\Images\Angry_Birds\bg2.jpg (10665, 2014-06-06)
Yc.QrCode.Test\QrCodeModel\Images\Angry_Birds\bg3.jpg (15334, 2014-06-06)
Yc.QrCode.Test\QrCodeModel\Images\Angry_Birds\bg4.png (65433, 2014-06-06)
Yc.QrCode.Test\QrCodeModel\Images\Angry_Birds\bg5.jpg (19518, 2014-06-06)
Yc.QrCode.Test\QrCodeModel\Images\Angry_Birds\boom.png (8012, 2014-06-06)
Yc.QrCode.Test\QrCodeModel\Images\Angry_Birds\desk.png (9019, 2014-06-06)
Yc.QrCode.Test\QrCodeModel\Images\Angry_Birds\fixedShape1.png (6063, 2014-06-06)
Yc.QrCode.Test\QrCodeModel\Images\Angry_Birds\fixedShape1_0.png (5403, 2014-06-06)
Yc.QrCode.Test\QrCodeModel\Images\Angry_Birds\fixedShape2_0.png (4519, 2014-06-06)
Yc.QrCode.Test\QrCodeModel\Images\Angry_Birds\grass.png (28834, 2014-06-06)
Yc.QrCode.Test\QrCodeModel\Images\Angry_Birds\grass2.png (33747, 2014-06-06)
Yc.QrCode.Test\QrCodeModel\Images\Angry_Birds\ire.png (5450, 2014-06-06)
Yc.QrCode.Test\QrCodeModel\Images\Angry_Birds\ire2.png (5392, 2014-06-06)
Yc.QrCode.Test\QrCodeModel\Images\Angry_Birds\pig1.png (13489, 2014-06-06)
Yc.QrCode.Test\QrCodeModel\Images\Angry_Birds\pig2.png (9504, 2014-06-06)
Yc.QrCode.Test\QrCodeModel\Images\Angry_Birds\pig3.png (14142, 2014-06-06)
Yc.QrCode.Test\QrCodeModel\Images\Angry_Birds\pig4.png (10361, 2014-06-06)
Yc.QrCode.Test\QrCodeModel\Images\Angry_Birds\pig5.png (11925, 2014-06-06)
... ...
YcQrCode
========
码晒客/疯狂创意二维码,底层 ,模版制作开源
public override Bitmap Encode(string content)
{
try
{
matrix = QrCodeEncoder.calQrcode(EnCoding.GetBytes(content));
}
catch { throw new Exception("内容超出范围,请选择更高版本或者降低容错率"); }
this.SetParam();
//SolidBrush Backbrush = new SolidBrush(QrCodeEncoder.QRCodeBackgroundColor);
SolidBrush Backbrush = new SolidBrush(Color.Transparent);//背景透明
SolidBrush Forebrush = new SolidBrush(QrCodeEncoder.QRCodeForegroundColor);
Bitmap image = new Bitmap(this.QrCodeW, this.QrCodeH);
Graphics g = Graphics.FromImage(image);
Rectangle rect = new Rectangle();
g.FillRectangle(Backbrush, new Rectangle(0, 0, image.Width, image.Height));
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(), Backbrush);
}
else
ChangeFillShape(g, Backbrush, rect, EN_FillShape.FillRectangle, new FillShape(), Backbrush);
}
}
return image;
}
blog:
http://www.cnblogs.com/cheng5x
码晒客讨论QQ群:
28629273
近期下载者:
相关文件:
收藏者: