B4J Question Avoid the knurling when import image into label programatically

Hello everybody,

I imported an image in the designer into a label. The image was built from SVG and exported to PNG. For some reason, the result is not being the best, because for no apparent reason the image appears jagged.

Actually I need to programmatically import it, but I can't understand the correct way to do it.
Are there any directives to avoid the knurling ? How do I do that
Thanks in advance
 

DonManfred

Expert
Licensed User
Longtime User
If you export an SVG as an png the resulting image should have 100% precision/Quality.
Exporting it as 1024x1024 Image will result in an 1024x1024 Image with 100% precision/Quality.

So the real question is:
In what size you did exported the SVG?
In what size you are USING the png in your app?

Upload a small project showing the problem
 
Upvote 0
If you export an SVG as an png the resulting image should have 100% precision/Quality.
Exporting it as 1024x1024 Image will result in an 1024x1024 Image with 100% precision/Quality.

So the real question is:
In what size you did exported the SVG?
In what size you are USING the png in your app?

Upload a small project showing the problem
Hi DonManfred,

The SVG edition is 3038,934 X 3022,373 px. I added printscreens of this edition, the properties in the designer and the frame of the app.
 

Attachments

  • Image applied in designer- properties.png
    Image applied in designer- properties.png
    105.3 KB · Views: 94
  • Image applied to imageview in Designer.png
    Image applied to imageview in Designer.png
    95.2 KB · Views: 101
Upvote 0
Tried to load programatically. The result is better but still not good.
The printscreen is attached.
B4X:
'Icons
            Dim IconImage As Image = xui.LoadBitmapResize(File.DirAssets, baseIcon(i) ,100 * imv_BaseIcon.Width / 100,100 * imv_BaseIcon.Height / 100, True)
      '     Dim IconImage As B4XBitmap = xui.LoadBitmap(File.DirAssets, baseIcon(i))
            imv_BaseIcon.SetImage(IconImage)
 

Attachments

  • load image programatically into ImageView.png
    load image programatically into ImageView.png
    156 KB · Views: 104
Upvote 0
Top