コード例 #1
0
		/// <summary>
		/// Responsible for creating a GDI image with the resulting QR code on it 
		/// (which is in turn built by the third-party API)
		/// </summary>
		/// <returns>
		/// GDI Image object with the QR code rendered on it (ready to be added onto the template).
		/// </returns>
		public System.Drawing.Image GetQRCodeImage() {
			System.Drawing.Image bitmap = null;
		
			Helpers.QRCoder encoder = new Helpers.QRCoder();
			encoder.EncoderType = this._EncodingType;	
			encoder.ErrorCorrection = this._ErrorCorrectionLevel;
			encoder.Size = this._Scale;
			encoder.Version = this._Version;

			// and pass over to the 3rd party API for encoding as an image
			bitmap = encoder.GenerateImage(_Data);
			
			encoder = null;

			return bitmap;
		}
コード例 #2
0
ファイル: QRCode.cs プロジェクト: toepoke/PosterBuilder
        /// <summary>
        /// Responsible for creating a GDI image with the resulting QR code on it 
        /// (which is in turn built by the third-party API)
        /// </summary>
        /// <returns>
        /// GDI Image object with the QR code rendered on it (ready to be added onto the template).
        /// </returns>
        public System.Drawing.Image GetQRCodeImage()
        {
            System.Drawing.Image bitmap = null;

            Helpers.QRCoder encoder = new Helpers.QRCoder();
            encoder.EncoderType = this._EncodingType;
            encoder.ErrorCorrection = this._ErrorCorrectionLevel;
            encoder.Size = this._Scale;
            encoder.Version = this._Version;

            // and pass over to the 3rd party API for encoding as an image
            bitmap = encoder.GenerateImage(_Data);

            encoder = null;

            return bitmap;
        }