android - How canvas.getClipBound works -
i want know internals of canvas.getclipbound method. please guide me building understanding.
for example: while drawing on canvas , zoomed , using clipbounds can scrolled x , y positions asking
int l = canvas.getclipbound().left; int t = canvas.getclipbound().top;
i want know how works internally.
suppose canvas has width , height 480x800 , have drawn on it. once zoom it, android system calculate how area of current canvas can shown user particular zoom level, , area clipped. example, actual displayable area of canvas once zoomed 300x500, clip area same 300x500, means, 300x500 zoomed , shown in 480x800 display. in example, rest of area ( width & height) of original canvas not displaying can calculated
xscroll = 480-300;
and
yscroll = 800-500;
canvas.getclipbound().left;
gives how zoomed screen scrolled horizontally , canvas.getclipbound().top;
shows how scrolled vertically.
hope you.
Comments
Post a Comment