Neos.IdentityServer 3.0/Neos.IdentityServer.QrCodeNet/Windows/Render/WriteableBitmapRenderer.cs
/// <summary>
/// Draw QrCode at given writeable bitmap at offset location
/// </summary>
Draw QrCode at given writeable bitmap at offset location
Draw QrCode at given writeable bitmap at offset location
public void Draw(WriteableBitmap wBitmap, BitMatrix matrix, int offsetX, int offsetY)
        {
            DrawingSize size = matrix == null ? ISize.GetSize(21) : ISize.GetSize(matrix.Width);
            if (wBitmap == null)
                wBitmap = new WriteableBitmap(size.CodeWidth + offsetX, size.CodeWidth + offsetY, 96, 96, PixelFormats.Gray8, null);
            else if (wBitmap.PixelHeight == 0 || wBitmap.PixelWidth == 0)
                return; 
            this.DrawQuietZone(wBitmap, size.CodeWidth, offsetX, offsetY);
            if (matrix == null)
                return;
            this.DrawDarkModule(wBitmap, matrix, offsetX, offsetY);
        }
public void Draw ( WriteableBitmap wBitmap , BitMatrix matrix , int offsetX , int offsetY ) { DrawingSize size = matrix == null ? ISize . GetSize ( 21 ) : ISize . GetSize ( matrix . Width ) ; if ( wBitmap == null ) wBitmap = new WriteableBitmap ( size . CodeWidth + offsetX , size . CodeWidth + offsetY , 96 , 96 , PixelFormats . Gray8 , null ) ; else if ( wBitmap . PixelHeight == 0 || wBitmap . PixelWidth == 0 ) return ; this . DrawQuietZone ( wBitmap , size . CodeWidth , offsetX , offsetY ) ; if ( matrix == null ) return ; this . DrawDarkModule ( wBitmap , matrix , offsetX , offsetY ) ; }
Draw QrCode at given writeable bitmap at offset location
Draw QrCode at given writeable bitmap at offset location
//writeablebitmap contains no pixel.
wBitmap
WriteableBitmap
matrix
BitMatrix
offsetX
int
offsetY
int