Saturday, October 29, 2011

[android-developers] SurfaceView no longer adjusts canvas to screen size?

I've run into a weird glitch.

Since the early versions of the SDK, I've been using a SurfaceView to
draw graphics, painting a bitmap into the canvas and then drawing/
painting on top of it, while adjusting the drawing dependent on the
density of the phone.

Since SDK14, however, this behavior seems to have changed.

Even though I run it on a 480x800 HDPI view, the SurfaceView returns
320x460 in the code for the dimensions of the view and the same for
the canvas in the code. This of course messes up everything, as I
still scale my drawing. If I remove the scaling, it works correctly
again, as the SurfaceView seems to be automatically scaled up
according to the density settings, but it looks terrible now (since
the graphics are scaled up 1.5 - before the SurfaceView used the hdpi
graphics, now it seems to use the mdpi graphics which are then scaled
up).

Is this intentional? Did I miss a memo somewhere?

--
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+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate