Android Question B4XView.SetBitmap(SVG.export..

Nicolás Cieri

Active Member
Licensed User
This library on iOS is great!, but for B4A.. I can't find anything like this.

I tried..

B4X:
public Sub setSvg(svg As SVG, im As B4XView)
    Dim canvas1 As Canvas
    Dim rect1 As Rect
    rect1.Initialize(0, 0, im.Width, im.Height)
    im.Color = Colors.Transparent
    canvas1.Initialize(im)
    svg.DrawPicture(canvas1, rect1)   
End Sub

But... for a strange reason this changed the color of some files that work perfectly on iOS.

And I can't get the Bitmap, to dynamically load it if the control doesn't exist yet (like in B4i).

Thanks.
 

Nicolás Cieri

Active Member
Licensed User
That's right, I was comparing with the B4i.

I think I have already solved the problem.

If the SVG's style (color) comes in "style" tag, the B4A library doesn't work for it.
I had to change the style on all my files and put it directly as an attribute on each file.

Now is working with the right color.

Libraries (SVG) work differently (files are not read the same way.) on B4i and B4a, but maybe this information will help someone.

Thanks Erel!.
 
Upvote 0
Top