Canvas.getWidth/getHeight() return the size of the Canvas. The dimension of
the Canvas is decided by the caller of your draw() method. It would be
legitimate for instance for every View to use a different Canvas (which is
actually what happens when hardware acceleration is enabled.)

The dimensions you should care about are View.getWidth/getHeight and
Canvas.getClipBounds.


On Thu, Jan 31, 2013 at 5:19 PM, dashman <[email protected]> wrote:

> As I delve into the Canvas class - here's my first of many questions
>
> I've got a sub-class and handling onDraw()
>
> why does canvas.getWidth()/getHeight() return the full dimensions of
> the device screen.
>
> whereas canvas.getClipBounds() returns a more accurate dimensions of
> the canvas view.
>
> How do I get an accurate dimension of the viewable screen area - not
> dependent on the clip rect.
>
>
>  --
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Android Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>



-- 
Romain Guy
Android framework engineer
[email protected]

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to