Android Question PNG transparency lost after updating to B4A 13.40 (signature captured from Panel/Canvas)

Pedro Caldeira

Active Member
Licensed User
Longtime User
Hello everyone,

I have an app that captures a user's signature from a Panel used as a canvas and saves it to a PNG file:

Save Signature code:
Sub Save(SD As SignatureData, Dir As String, Name As String)
    Dim out As OutputStream
    out = File.OpenOutput(Dir, Name, False)
    SD.Canvas.Bitmap.WriteToStream(out, 100, "PNG")
    out.Close
End Sub

I then print that image with the EscPOSPRINTER class together with other content in a 40‑column report.

On B4A 12.80 everything works as expected. After updating to 13.40, it looks like the image transparency is lost: the printout shows solid/filled rectangles instead of the signature over a transparent background.

This seems to be related to how the image is saved. If I capture and save the signature using an APK compiled with 12.80, then update the app to the exact same code compiled with 13.40, the printout remains correct (no dark rectangles, transparency preserved). If I capture and save the signature with the 13.40 build, I get the dark smudges.

Any ideas ?
 

Attachments

  • I_250916_171656_31461.jpeg
    377.1 KB · Views: 53

Pedro Caldeira

Active Member
Licensed User
Longtime User
Can you upload the saved PNG?
Here you have 4 png, 2 saved with v12.80 and 2 saved with v.13.40
Opening them via GIMP, they show the ones created via v13.40 as transparente png, instead of the ones created via v12.80, but strangely they appear black both in android and sometimes windows explorer, they sure appear black while trying to print them.
The first ticket printed correctly both in v12.80 and 13.40 as long as the image was saved in 12.80 the second is saved directly in 13.40.

Thanks in advance
 

Attachments

  • signature_1_1280.png
    37.1 KB · Views: 16
  • signature_1_1340.png
    27 KB · Views: 10
  • signature_2_1280.png
    51.7 KB · Views: 8
  • signature_2_1340.png
    25.1 KB · Views: 9
  • ticket_signatures_1280.jpg
    110.5 KB · Views: 10
  • ticket_signatures_1340.jpg
    138.7 KB · Views: 13
  • images_in_device.png
    132.9 KB · Views: 12
Last edited:
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…