private int CalculateSuitableWidth(int width, int bitMatrixWidth) { FixedCodeSize isize = new FixedCodeSize(width, m_QuietZoneModule); DrawingSize dSize = isize.GetSize(bitMatrixWidth); int gap = dSize.CodeWidth - dSize.ModuleSize * (bitMatrixWidth + 2 * (int)m_QuietZoneModule); if (gap == 0) { return(width); } else if (dSize.CodeWidth / gap < 6) { return((dSize.ModuleSize + 1) * (bitMatrixWidth + 2 * (int)m_QuietZoneModule)); } else { return(dSize.ModuleSize * (bitMatrixWidth + 2 * (int)m_QuietZoneModule)); } }