|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectView
com.blogspot.applications4android.comicreader.zoom.PanZoomView
public class PanZoomView
Main class responsible for holding a bitmap in order to zoom and pan on it. It's the responsibility of the PanZoomControl to call 'invalidate' when there's something to be updated on the view!
Constructor Summary | |
---|---|
PanZoomView(Context context,
AttributeSet attrs)
Constructor. |
Method Summary | |
---|---|
float |
getAspectRatio()
Get the current value of aspect ratio. |
PanZoomControl |
getController()
Give the controller for pan/zoom |
Bitmap |
getImageBitmap()
current bitmap |
int |
getImageHeight()
Get the image height (in pixels) |
int |
getImageWidth()
Get the image width (in pixels) |
float |
getPanX()
Get the current pan-x value. |
float |
getPanY()
Get the current pan-y value |
float |
getZoom()
Get the current zoom level. |
float |
getZoomX()
Get the current value of zoom along X-axis. |
float |
getZoomY()
Get the current value of zoom along Y-axis. |
protected void |
onDraw(Canvas canvas)
How to draw this view? |
protected void |
onLayout(boolean changed,
int left,
int top,
int right,
int bottom)
updates the aspect ratio in event of a layout change. |
void |
setController(PanZoomControl mc)
Set the controller for this view |
void |
setImageBitmap(Bitmap bm)
bitmap which needs to be zoomed and/or panned. |
void |
setPanXY(float panx,
float pany)
Set the value of pan along X-axis and Y-axis. |
void |
setZoom(float zoom)
Set the value of zoom level. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PanZoomView(Context context, AttributeSet attrs)
context
- context of the activity.attrs
- attributes for this view.Method Detail |
---|
public PanZoomControl getController()
public void setController(PanZoomControl mc)
mc
- controllerpublic void setImageBitmap(Bitmap bm)
bm
- the bitmap of interest.public Bitmap getImageBitmap()
protected void onDraw(Canvas canvas)
canvas
- canvas where to drawprotected void onLayout(boolean changed, int left, int top, int right, int bottom)
changed
- whether the orientation changed or notleft
- leftmost part of the rectangletop
- topmost part of the rectangleright
- rightmost part of the rectanglebottom
- bottom-most part of the rectanglepublic int getImageWidth()
public int getImageHeight()
public float getPanX()
public float getPanY()
public float getZoomX()
public float getZoomY()
public float getZoom()
public float getAspectRatio()
public void setPanXY(float panx, float pany)
panx
- value of pan along X-axis.pany
- value of pan along Y-axis.public void setZoom(float zoom)
zoom
- value of zoom level.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |