Encode() public static method

public static Encode ( String content, ErrorCorrectionLevel ecLevel, Object>.IDictionary hints, QRCode qrCode ) : void
content String
ecLevel ErrorCorrectionLevel
hints Object>.IDictionary
qrCode QRCode
return void
        public ByteMatrix Encode(string contents, int width, int height,
                                 IDictionary <EncodeHintType, object> hints)
        {
            if (contents == null || contents.Length == 0)
            {
                throw new ArgumentException("Found empty contents");
            }

            if (width < 0 || height < 0)
            {
                throw new ArgumentException("Requested dimensions are too small: " + width + 'x' +
                                            height);
            }

            var errorCorrectionLevel = ErrorCorrectionLevel.L;

            if (hints != null && hints.ContainsKey(EncodeHintType.ERROR_CORRECTION))
            {
                errorCorrectionLevel = (ErrorCorrectionLevel)hints[EncodeHintType.ERROR_CORRECTION];
            }

            var code = new QRCode();

            Encoder.Encode(contents, errorCorrectionLevel, hints, code);
            return(RenderResult(code, width, height));
        }