public class CPDFInkAnnotAttachHelper extends java.lang.Object implements IAnnotAttachHelper, IInkDrawCallback
IInkDrawCallback.Effect, IInkDrawCallback.Mode| Constructor and Description |
|---|
CPDFInkAnnotAttachHelper() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canRedo()
Whether to support Redo, is a time-consuming method.
|
boolean |
canUndo()
Whether to support Undo, is a time-consuming method.
|
void |
eraseDraw(float x,
float y)
橡皮擦轨迹,擦除手绘轨迹中的点。
算法说明:
1.橡皮擦轨迹是一个一个的点连接起来的,而擦除的范围是以每一个点为中心,半径为radius的圆;
2.擦除mDrawing中的点的算法:取同一线条上相邻的两个点绘制线段,计算该线段与圆的交点:
(1)如果线段的两个顶点在圆外,且与圆有两个交点,那么一个交点作为前一条线条的末尾,另一个交点作为后一条线条的开始;
(2)如果线段的一个顶点在圆外,一个顶点在圆内,那么圆内的点抹去,交点作为一条线条上的点;
(3)如果线段的两个顶点都在圆内,那么这两个点都抹去。
|
void |
onClean()
Clears canvas
|
void |
onDraw(android.graphics.Canvas canvas)
Implement this to do your drawing.
|
void |
onInit(CPDFReaderView readerView,
CPDFPageView pageView)
Initialization, set initial value of
CPDFReaderView and CPDFPageView in current class instance. |
void |
onRedo()
Redo
|
void |
onSave()
Saves ink annotation
|
boolean |
onTouchEvent(android.view.MotionEvent event)
This method to handle touch screen motion events
|
void |
onUndo()
Undo
|
void |
setEffect(IInkDrawCallback.Effect effect)
Sets stroke effect, more:
IInkDrawCallback.Effect |
void |
setMode(IInkDrawCallback.Mode mode)
Sets drawing mode, more:
IInkDrawCallback.Mode |
void |
setPDFPage(CPDFPage pdfPage)
Sets page object of the document, more:
CPDFPage |
public void onInit(CPDFReaderView readerView, CPDFPageView pageView)
IAnnotAttachHelperCPDFReaderView and CPDFPageView in current class instance.onInit in interface IAnnotAttachHelperreaderView - Used for showing View in the whole documentpageView - Used for showing View of each page in the document.public void setPDFPage(CPDFPage pdfPage)
IAnnotAttachHelperCPDFPagesetPDFPage in interface IAnnotAttachHelperpdfPage - Page object of the document, more: CPDFPagepublic boolean onTouchEvent(android.view.MotionEvent event)
IAnnotAttachHelperonTouchEvent in interface IAnnotAttachHelperevent - The motion event.public void onDraw(android.graphics.Canvas canvas)
IAnnotAttachHelperonDraw in interface IAnnotAttachHelpercanvas - The canvas on which the background will be drawnpublic void onUndo()
IInkDrawCallbackonUndo in interface IInkDrawCallbackpublic void onRedo()
IInkDrawCallbackonRedo in interface IInkDrawCallbackpublic boolean canUndo()
IInkDrawCallbackcanUndo in interface IInkDrawCallbackpublic boolean canRedo()
IInkDrawCallbackcanRedo in interface IInkDrawCallbackpublic void onClean()
IInkDrawCallbackonClean in interface IInkDrawCallbackpublic void onSave()
IInkDrawCallbackonSave in interface IInkDrawCallbackpublic void setMode(IInkDrawCallback.Mode mode)
IInkDrawCallbackIInkDrawCallback.ModesetMode in interface IInkDrawCallbackmode - Drawing mode, more: IInkDrawCallback.Modepublic void setEffect(IInkDrawCallback.Effect effect)
IInkDrawCallbackIInkDrawCallback.EffectsetEffect in interface IInkDrawCallbackeffect - Stroke effectpublic void eraseDraw(float x,
float y)