iTextSharp.text.pdf.qrcode.ErrorCorrectionLevel.ForBits C# (CSharp) Method

ForBits() public static method

public static ForBits ( int bits ) : ErrorCorrectionLevel
bits int
return ErrorCorrectionLevel
        public static ErrorCorrectionLevel ForBits(int bits) {
            if (bits < 0 || bits >= FOR_BITS.Length) {
                throw new IndexOutOfRangeException();
            }
            return FOR_BITS[bits];
        }
    }

Usage Example

 private FormatInformation(int formatInfo)
 {
     // Bits 3,4
     errorCorrectionLevel = ErrorCorrectionLevel.ForBits((formatInfo >> 3) & 0x03);
     // Bottom 3 bits
     dataMask = (byte)(formatInfo & 0x07);
 }