You are right, what a noob error :(
Thank you man.

On Sep 17, 11:10 pm, Romain Guy <romain...@android.com> wrote:
> You are probably using drawable/ or drawable-mdpi/ assets on an hdpi
> device and your assets get scaled automatically.
>
> On Fri, Sep 17, 2010 at 10:00 AM, jlopeznava...@gmail.com
>
>
>
>
>
> <jlopeznava...@gmail.com> wrote:
> > Hi, I am using some drawable objects, when I instance them and paint
> > in my canvas they doesn't get the original PNG image file size,
> > instead they get a bigger size, so they does't paint in my canvas as I
> > expected since I wanted them in their original sizes, why this
> > happens???
>
> > (original file is 96x96 pixels)
>
> > --------------------------------------------------------------------------- 
> > -----------------------------------------------------------
> > mSprite = mRes.getDrawable(R.drawable.my_sprite);
>
> > mSpriteWidth = mSprite.getIntrinsicWidth(); // It returns 114, not 96
> > mSpriteHeight = mSprite.getIntrinsicHeight(); // It returns 114, not
> > 96
>
> > mSprite.setBounds(coordX, coordY, coordX + mSpriteWidth, coordY +
> > mSpriteHeight);
> > mSprite_PipeRect.draw(canvas); //It paints at 114x114 size, it shows
> > bigger in the screen then original size
>
> > --------------------------------------------------------------------------- 
> > -----------------------------------------------------------
>
> > Something similar happens with the background but it is fixed in the
> > "setSurfaceSize" event this way:
>
> > public void setSurfaceSize(int width, int height) {
> >           mBackgroundImage =
> > Bitmap.createScaledBitmap(mBackgroundImage, width, height,
> > true);
> > }
>
> > In this case height and widht is properly provided in the event
> > parameters
>
> > --------------------------------------------------------------------------- 
> > -----------------------------------------------------------
>
> > Why are not loaded in their original size, and how to get original
> > size for my drawables???
>
> > Thanks in advance.
>
> > --
> > 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
>
> --
> Romain Guy
> Android framework engineer
> romain...@android.com
>
> Note: please don't send private questions to me, as I don't have time
> to provide private support.  All such questions should be posted on
> public forums, where I and others can see and answer them

-- 
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