public class PaintDrawProcessor extends SimpleProcessor
brushSnap, currentSnap, mBrushScale, mCurrentBrush, originalImage, originalSnap, smudgeCanvas
构造器和说明 |
---|
PaintDrawProcessor()
设置默认缩放3.0f
|
限定符和类型 | 方法和说明 |
---|---|
protected void |
destroy() |
protected void |
drawAtPoint(float x,
float y,
float d,
float scale,
float angle)
因继承自SimpleProcessor 但是未使用父类绘制算法,所以抛出UnsupportedOperationException()
|
protected android.graphics.Bitmap |
getCanvasImage()
get preview image
|
protected int |
getImageHeight()
获取适应屏幕后的图片高度
|
protected int |
getImageWidth()
获取适应屏幕后的图片宽度
|
protected float |
getMaxTemplateDistance(float mBrushScale)
最大间距
|
protected int |
getMaxUndoCount()
允许撤销的次数 (默认: 5)
|
protected android.graphics.Bitmap |
getOriginalImage() |
protected int |
getRedoCount()
允许重做的次数
|
protected android.graphics.Bitmap |
getRedoData() |
protected android.graphics.Bitmap |
getSmudgeImage(android.graphics.Bitmap image,
boolean recycle) |
protected int |
getUndoCount()
允许撤销的次数
|
protected android.graphics.Bitmap |
getUndoData() |
protected void |
init(android.graphics.Bitmap originalImage,
android.graphics.Bitmap scaledImage,
int screenWidth)
初始化
|
protected void |
pathMove(android.graphics.PointF tempPoint) |
protected void |
saveCurrentAsHistory()
保存当前绘制进历史记录
|
void |
setBrushScale(float brushScale) |
void |
setBrushSize(BrushSize.SizeType size) |
void |
setBrushSize(BrushSize.SizeType size,
float brushScale) |
protected void |
setMaxUndoCount(int mMaxUndoCount)
允许撤销的次数 (默认: 5)
|
void |
setMinDistance(float mMinDistance) |
void |
setPaintCap(android.graphics.Paint.Cap mPaintCap) |
void |
setPaintColor(int mPaintColor) |
void |
setPaintJoin(android.graphics.Paint.Join mPaintJoin) |
protected void |
touchBegan(android.graphics.PointF startPoint) |
protected void |
touchEnd()
结束移动
|
drawBetweenPoints, getBrush, setBrush, touchBegan
public void setMinDistance(float mMinDistance)
protected void drawAtPoint(float x, float y, float d, float scale, float angle)
drawAtPoint
在类中 SimpleProcessor
x
- y
- d
- scale
- angle
- protected android.graphics.Bitmap getSmudgeImage(android.graphics.Bitmap image, boolean recycle)
getSmudgeImage
在类中 SimpleProcessor
image
- 源图recycle
- 是否回收 image 对象protected void destroy()
destroy
在类中 SimpleProcessor
public void setPaintCap(android.graphics.Paint.Cap mPaintCap)
mPaintCap
- 线条头样式设置public void setPaintJoin(android.graphics.Paint.Join mPaintJoin)
mPaintJoin
- 线条拐角样式设置public void setPaintColor(int mPaintColor)
mPaintColor
- 画笔颜色设置protected void init(android.graphics.Bitmap originalImage, android.graphics.Bitmap scaledImage, int screenWidth)
SimpleProcessor
init
在类中 SimpleProcessor
originalImage
- 原始图像scaledImage
- 适应屏幕尺寸的图像screenWidth
- 视图宽度protected int getImageWidth()
SimpleProcessor
getImageWidth
在类中 SimpleProcessor
protected int getImageHeight()
SimpleProcessor
getImageHeight
在类中 SimpleProcessor
public void setBrushSize(BrushSize.SizeType size)
setBrushSize
在类中 SimpleProcessor
size
- 获取当前画笔大小public void setBrushScale(float brushScale)
brushScale
- 设置当前画笔缩放大小 (默认:3.0f,范围1.0f-3,0f)public void setBrushSize(BrushSize.SizeType size, float brushScale)
size
- 当前笔刷型号brushScale
- 当前缩放大小protected int getMaxUndoCount()
SimpleProcessor
getMaxUndoCount
在类中 SimpleProcessor
protected void setMaxUndoCount(int mMaxUndoCount)
SimpleProcessor
setMaxUndoCount
在类中 SimpleProcessor
protected int getRedoCount()
SimpleProcessor
getRedoCount
在类中 SimpleProcessor
protected int getUndoCount()
SimpleProcessor
getUndoCount
在类中 SimpleProcessor
protected void saveCurrentAsHistory()
SimpleProcessor
saveCurrentAsHistory
在类中 SimpleProcessor
protected android.graphics.Bitmap getRedoData()
getRedoData
在类中 SimpleProcessor
protected android.graphics.Bitmap getUndoData()
getUndoData
在类中 SimpleProcessor
protected android.graphics.Bitmap getCanvasImage()
SimpleProcessor
getCanvasImage
在类中 SimpleProcessor
protected android.graphics.Bitmap getOriginalImage()
getOriginalImage
在类中 SimpleProcessor
protected void touchBegan(android.graphics.PointF startPoint)
startPoint
- 触摸开始事件protected void pathMove(android.graphics.PointF tempPoint)
tempPoint
- 当前点坐标
手指移动同时绘制protected void touchEnd()
protected float getMaxTemplateDistance(float mBrushScale)
SimpleProcessor
getMaxTemplateDistance
在类中 SimpleProcessor
mBrushScale
- 笔刷缩放