---
title: "C# DataMatrix.net使用"
author: "thoreau"
date: "2016-05-03T12:19:38Z"
tags: []
categories: ["行业应用"]
slug: "c-datamatrix-net"
draft: false
lastmod: "2016-05-03T12:22:14Z"
id: 2295354
url: "https://thoreau.iteye.com/blog/2295354"
---

使用DataMatrix.net.dll来生成二维码，可控制二维码长宽

 

样例代码：

```
DmtxImageEncoder Die = new DmtxImageEncoder();
DataMatrix.net.DmtxImageEncoderOptions option = new DmtxImageEncoderOptions();
option.SizeIdx = DmtxSymbolSize.DmtxSymbol16x16;//形状
option.MarginSize = 0;//边距
option.ModuleSize = 3;//点阵大小

string txt = "123abc";
Bitmap b = Die.EncodeImage(txt, option);
```