Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
26filip
Posts: 232
Registered: ‎01-30-2011
My Device: Dev Alpha C, Z10 LE

Terrible image scaling in custom control

I create my own control, which contains inter alai simple ImageView:

 

ImageView {
        imageSource: "asset:///img/corner.png"
        scalingMethod: ScalingMethod.AspectFit
        preferredWidth: 13
        preferredHeight: 13
        horizontalAlignment: HorizontalAlignment.Left
        verticalAlignment: VerticalAlignment.Top
    }

 corner.png: corner.png

 

But on device it look very bad: IMG_00000280.png

 

I tried many scalingMethod, but everyone is bad choice.

 

However, when I put ImageView (code from custom control) in Container in main.qml (over custom controls), everything works fine - on device images looks as good as on computer...

 

 

Anyone could help me? :smileywink:

All time online :smileyvery-happy:
Developer
Zmey
Posts: 1,512
Registered: ‎12-18-2012
My Device: PlayBook, Z10, DAC

Re: Terrible image scaling in custom control

Hi,

This looks like a scaling artefact. The first thing I would check is the actual size of ImageView for both cases by attaching a LayoutUpdateHandler to it and printing the width and height.

Andrey Fidrya, @zmeyc on twitter