nuget 安装 DataMatrix.net //示例 DmtxImageEncoder Die = new DmtxImageEncoder(); DataMatrix.net.DmtxImageEncoderOptions option = new DmtxImageEncoderOptions(); option.SizeIdx = DmtxSymbolSize.DmtxSymbol32x32;//形状 option.MarginSize = 0;//边距 option.ModuleSize = size;//点阵大小 //string txt = "123abc"; Bitmap b = Die.EncodeImage(codeText, option); g.DrawImage(b,new Point(pointX, pointY)); 内容太长报错:使用 Die.EncodeImage("xxxxxxxxxxxxxxxxxx",2)