CartoDB / mobile-sdk

CARTO Mobile SDK core project
https://carto.com/docs/carto-engine/mobile-sdk/
BSD 3-Clause "New" or "Revised" License
186 stars 68 forks source link

bitmap in Balloon gets blurry #254

Closed alizeyn closed 5 years ago

alizeyn commented 5 years ago

When I add a balloon with a PNG bitmap inside, the bitmap get blurry while orginal picture is ok. I think if it needs any special setting this should be mentioned on documentation else it's a bug.

my Balloon style now :

        BalloonPopupStyleBuilder builder = new BalloonPopupStyleBuilder();
        org.rajman.graphics.Color color = new org.rajman.graphics.Color(0xff0277BD);
        builder.setColor(color);
        builder.setLeftColor(color);
        builder.setCausesOverlap(true);
        builder.setCornerRadius(36);
        builder.setTriangleHeight(16);
        builder.setTriangleWidth(16);
//        builder.setScaleWithDPI(true);
        Bitmap bitMapLeft = org.rajman.neshan.utils.BitmapUtils.loadFromResource(this, R.drawable.add_stop);
        builder.setLeftImage(BitmapUtils.createBitmapFromAndroidBitmap(bitMapLeft));

I've checked setScaleWithDPI and it does not fix anything.

jaakla commented 5 years ago

There could be build-time resolution scaling depending on under which dpi category you define the resource file.