[android-developers] Re: canvas.scale and text size bug

2008-04-04 Thread freeanderson

I mean if the physical pixel width of "abcd" is 30px when
canvas.scale(1.0f, 1.0f),
then doesn't it have to be 15px when canvas.scale(0.5f, 0.5f)?
other drawing object like rectangle, circle, bitmap and etc are drawn
correctly without matter of canvas.scale.
if i draw one rectangle physically (10,10,20,20) by scale as 1.0f
and after i changed scale to 0.5f, then it is drawn at (5, 5, 10, 10)
correctly.
but drawText has various physical width by scale.
isn't it bug? if it's not bug, how can we use scale method correctly
with other drawing method and drawText?

On Apr 4, 4:22 pm, "Romain Guy" <[EMAIL PROTECTED]> wrote:
> Using scale(0.5f, 0.5f) just means that the text will be drawn at half
> its size, not that it will be drawn to fit in a rectangle that is half
> the size of the screen. It depends on the length of the text you are
> drawing, the font size and the type face you are using.
>
>
>
> On Thu, Apr 3, 2008 at 11:41 PM, freeanderson <[EMAIL PROTECTED]> wrote:
>
> >  hello,
>
> >  i'm using bitmap object to draw text like below step.
> >  first, i use the bitmapCanvas.scale(sx, sy);
> >  second,  text strings are drawn on the bitmap object.
> >  third, i draw the bitmap object to the real canvas by using
> >  canvas.drawBitmap(..).
> >  but sometimes text size is not fit to area when i change zoom in/out
> >  value.
>
> >  for example, now the screen size is 320x400 and i use
> >  bitmapCanvas.scale(0.5f, 0.5f); and if i draw text
> >  (ex: canvas.draw("i");)
> >  then the text has to be drawn in rect of 160x200 however it's drawn
> >  over the 160px.
> >  it's unstable by zoom value and it depends on current typeface.
> >  will this android bug be fixed?
>
> >  Thank you.
> >  andy
>
> --
> Romain Guywww.curious-creature.org
--~--~-~--~~~---~--~~
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
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: canvas.scale and text size bug

2008-04-04 Thread Romain Guy

Using scale(0.5f, 0.5f) just means that the text will be drawn at half
its size, not that it will be drawn to fit in a rectangle that is half
the size of the screen. It depends on the length of the text you are
drawing, the font size and the type face you are using.

On Thu, Apr 3, 2008 at 11:41 PM, freeanderson <[EMAIL PROTECTED]> wrote:
>
>  hello,
>
>  i'm using bitmap object to draw text like below step.
>  first, i use the bitmapCanvas.scale(sx, sy);
>  second,  text strings are drawn on the bitmap object.
>  third, i draw the bitmap object to the real canvas by using
>  canvas.drawBitmap(..).
>  but sometimes text size is not fit to area when i change zoom in/out
>  value.
>
>  for example, now the screen size is 320x400 and i use
>  bitmapCanvas.scale(0.5f, 0.5f); and if i draw text
>  (ex: canvas.draw("i");)
>  then the text has to be drawn in rect of 160x200 however it's drawn
>  over the 160px.
>  it's unstable by zoom value and it depends on current typeface.
>  will this android bug be fixed?
>
>  Thank you.
>  andy
>
>  >
>



-- 
Romain Guy
www.curious-creature.org

--~--~-~--~~~---~--~~
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
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---