Bug? Android 4.4 issues

NeoTechni

Well-Known Member
Licensed User
Longtime User
1) It's drawing text, hollow...
2) When drawing a PNG/GIF, it's drawing the transparency incorrectly.
 

Attachments

  • Capture.JPG
    Capture.JPG
    259 KB · Views: 406

NeoTechni

Well-Known Member
Licensed User
Longtime User
Is there a way using a reflection to turn that off globally on the canvas or would we have to replace every canvas.drawtext call?
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
@Erel: It's maybe due to the fact that your DrawText function uses Paint.Style.STROKE instead of Paint.Style.FILL.
This is probably the case.

You can try the attached core jar file.
It should fix the DrawText issue.

Copy core.jar to Basic4android internal libraries folder.
 

NeoTechni

Well-Known Member
Licensed User
Longtime User
Informatix: how woukd that work for an app consisting of thousands of draw commands? Would i have to replace each one?

Erel: thank you, ill let you know how it works
 

Informatix

Expert
Licensed User
Longtime User
Informatix: how woukd that work for an app consisting of thousands of draw commands? Would i have to replace each one?
If that works well with the change made by Erel, no you have nothing to do. My advice was a general advice in case you'd have strange issues with KitKat or you just want something more powerful. The canvas is, to my eyes, a deprecated class. I replaced it almost everywhere in my own code by the AS library to do the same thing. AS is faster, draws with anti-aliasing enabled, offers a lot more possibilities and its ease of use is very similar. But these two libraries are not exactly used in the same way (AS uses a Draw event), so you will have to rewrite some parts of your code.
 

NeoTechni

Well-Known Member
Licensed User
Longtime User
That's odd, I copied it to: C:\Program Files\Basic4android\Libraries
And I still have the problem. Did you do anything after that?
 

NeoTechni

Well-Known Member
Licensed User
Longtime User
I use it cause they take up less space than the same image in PNG, and take less work (I run my PNGs through tinyPNG.com)
They shouldn't be screwing devs over on a whim like this...
 

Informatix

Expert
Licensed User
Longtime User
I use it cause they take up less space than the same image in PNG, and take less work (I run my PNGs through tinyPNG.com)
They shouldn't be screwing devs over on a whim like this...
Supporting a format limited to 256 colors on a device able to display millions of colors is a strange choice from my point of view. I think that they added the support of GIF at the beginning because of the many web sites still using it, but even on Internet, this format is disappearing and some day this format will be definitely a thing of the past. I don't think that the difference with a PNG is huge after going through tinyPNG.
 
Top