Hi,
 
I have the same problem using setImageURI. The problem seems to be worse 
than just a scaling issue.
It seems that some vendors have fixed this bug for some of their devices.
I have a HTC Sensation that doesn't scale the image set through 
setImageURI. All other devices I know do.
For me the only workaround for this is to measure the applied scaling by 
instantiating an ImageView that consumes a sample image from my 
ContentProvider. The extra scaling for the images that has to be applied 
can be calculated by comparing the ImageViews size to the original size of 
the sample image.
 
Fixing this bug wouldn't change anything for the next 2 years as most of us 
developers want to support not only the last generation of Android devices 
;)
 
Greetings
 
Michael

Am Freitag, 17. Februar 2012 21:56:40 UTC+1 schrieb Yuvi:

> Hi, 
>
> sorry to resurrect this post...but I got into a similar problem. And as 
> the OP did, I'm using RemoteViews.setImageViewUri() to set my image on the 
> appwidget. However I noticed that my image is being scaled according to the 
> screen density.
>
> So, for example, on an XHDPI screen, if I have a bitmap which is 100x100 
> and I set it using setImageViewBitmap() I get the image to look as 100x100. 
> However, if I store that bitmap into a png on disk, and then use 
> setImageViewUri() my bitmap is displayed as 50x50.
>
> Do you know if there is a way to change this behavior? (i.e. if my image 
> is 100x100 I'd like it to remain 100x100 also after it is decoded).
> Maybe there is a way to force some density on the ImageView itself?
>
> My only workaround (which sucks..) is to scale-up the bitmap before 
> storing on disk so that when it is being decoded I get back my original 
> size. But in this way I use more memory to save the image and I also loose 
> image quality..:(
>
> I hope someone can help me!
> Thanks,
> Yuvi
>
> On Mon, Aug 1, 2011 at 8:05 PM, Ash McConnell  wrote:
>
>> Thanks Kostya and Dianne, setUri works as expected.  I had to create the 
>> files using context.openFileOutput.  Unfortunately that means I loose the 
>> ability to use directories.  I can't see a "Java" way to set permission on 
>> files, it can be done with native methods, but that seems like overkill. 
>>  I'll do some more googling. 
>>
>> Thanks again for the help, I was worried that this problem might have 
>> been a show-stopper.
>> Ash
>>   
>> -- 
>> You received this message because you are subscribed to the Google
>> Groups "Android Developers" group.
>> To post to this group, send email to android-developers@googlegroups.com
>> To unsubscribe from this group, send email to
>> android-developers+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/android-developers?hl=en
>>
>
>
>
> -- 
> YuviDroid 
> Check out Launch-X <http://android.yuvalsharon.net/launchx.php> (a widget 
> to quickly access your favorite apps and contacts!)
> http://android.yuvalsharon.net
>
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to