I am revisiting an old problem. A while back I was having problems with shortcut images not scaling correctly on all devices. They would show only a partial image as the icon... squashed, or too large and off-centered, etc.
I finally resolved this with help from Erel by retrieving drawables that I included with the app. See this thread.
Anyway, I am still having a problem, but it is when I allow the user to choose their own image from their SD card. It results in the same problem I initially had. They do not scale correctly. It seems that unless the image is a "drawable", it simply does not scale correctly when applied as a shortcut image.
Has anyone ever had this problem and solved it? Is there a way I can convert an image loaded from the SD card into a "drawable" through code? No matter what size the icon (png) is on my SD card (72x72, 96x96, 144x144, etc), it never renders correctly as a shortcut icon. It only works properly if loaded as a drawable resource from my app.
See also:
http://stackoverflow.com/questions/...t-extra-shortcut-icon-bmp-image-is-off-center
I tried using the method shown in the last post on Stack Overflow (basically getting the size that Android is using for the app's icon and scaling the loaded bitmap) but it still doesn't work properly.
I finally resolved this with help from Erel by retrieving drawables that I included with the app. See this thread.
Anyway, I am still having a problem, but it is when I allow the user to choose their own image from their SD card. It results in the same problem I initially had. They do not scale correctly. It seems that unless the image is a "drawable", it simply does not scale correctly when applied as a shortcut image.
Has anyone ever had this problem and solved it? Is there a way I can convert an image loaded from the SD card into a "drawable" through code? No matter what size the icon (png) is on my SD card (72x72, 96x96, 144x144, etc), it never renders correctly as a shortcut icon. It only works properly if loaded as a drawable resource from my app.
See also:
http://stackoverflow.com/questions/...t-extra-shortcut-icon-bmp-image-is-off-center
I tried using the method shown in the last post on Stack Overflow (basically getting the size that Android is using for the app's icon and scaling the loaded bitmap) but it still doesn't work properly.