Esempio n. 1
0
 public QrCodeController(QrCodeRenderOptions renderOptions, IQrCodeRenderer renderer, ApiKeyProvider apiKeyProvider, IImageService imageService, IConfiguration config)
 {
     this.renderOptions  = renderOptions;
     this.renderer       = renderer;
     this.apiKeyProvider = apiKeyProvider;
     this.imageService   = imageService;
     this.config         = config;
 }
Esempio n. 2
0
        public async Task InvokeAsync(HttpContext context, IConfiguration config, QrCodeRenderOptions options)
        {
            defaults     = config.GetSection("QrCodeDefaults");
            this.context = context;

            // Overwrite default with any user provided options
            options.EccLevel        = GetEccLevel();
            options.LightColour     = GetLightColour();
            options.DarkColour      = GetDarkColour();
            options.DrawQuietZones  = GetDrawQuietZones();
            options.PixelsPerModule = GetPixelsPerModule();
            options.RenderType      = GetRenderType();
            options.Preview         = GetPreview();

            await next(context);
        }
Esempio n. 3
0
 public QrCodeDataFactory(QrCodeRenderOptions renderOptions)
 {
     this.renderOptions = renderOptions;
     generator          = new QRCodeGenerator();
 }
 public QrCodeImageRenderer(QrCodeRenderOptions renderOptions)
 {
     this.renderOptions = renderOptions;
 }
Esempio n. 5
0
 public Renderer(QrCodeRenderOptions renderOptions)
 {
     dataFactory   = new QrCodeDataFactory(renderOptions);
     imageRenderer = new QrCodeImageRenderer(renderOptions);
 }