You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I need to remove transparency from a PNG and replace with white background. the commented out lines are things I have tried. it just keeps coming out transparent.
Imports SkiaSharp
Imports SkiaSharp.QrCode.Image
Using output = New FileStream(Application.StartupPath & "geo.png", FileMode.OpenOrCreate)
Dim Code = New QrCode("test qr code", New Vector2Slim(256, 256), SKEncodedImageFormat.Png)
Code.GenerateImage(output)
End Using
The text was updated successfully, but these errors were encountered:
`Private Function GenerateQrCode(ByVal content As String, ByVal width As Integer, ByVal height As Integer) As Byte()
Using generator = New QRCodeGenerator()
Dim qr = generator.CreateQrCode(content, ECCLevel.L)
Dim info = New SKImageInfo(width, height)
Using surface = SKSurface.Create(info)
Dim canvas = surface.Canvas
canvas.Clear(SKColors.White)
Using qrCodeRenderer = New QRCodeRenderer()
Dim area As SKRect = SKRect.Create(0, 0, info.Width, info.Height)
qrCodeRenderer.Render(canvas, area, qr, SKColors.Black)
End Using
Using image = surface.Snapshot()
Using data = image.Encode(SKEncodedImageFormat.Png, 100)
Using stream = File.OpenWrite(Application.StartupPath & "/geo.png")
data.SaveTo(stream)
End Using
Return data.ToArray()
End Using
End Using
End Using
End Using
End Function`
I need to remove transparency from a PNG and replace with white background. the commented out lines are things I have tried. it just keeps coming out transparent.
Imports SkiaSharp
Imports SkiaSharp.QrCode.Image
Using output = New FileStream(Application.StartupPath & "geo.png", FileMode.OpenOrCreate)
Dim Code = New QrCode("test qr code", New Vector2Slim(256, 256), SKEncodedImageFormat.Png)
Code.GenerateImage(output)
End Using
The text was updated successfully, but these errors were encountered: