use of com.lansosdk.box.CanvasRunnable in project LanSoEditor_advance by LanSoSdk.
the class ExecuteTwoVideoLayerDemoActivity method addCanvasLayer.
/**
* 增加一个CanvasLayer,
*/
private void addCanvasLayer() {
mCanvasLayer = mDrawPad.addCanvasLayer();
if (mCanvasLayer != null) {
mCanvasLayer.setClearCanvas(false);
mShowHeart = new ShowHeart(ExecuteTwoVideoLayerDemoActivity.this, mCanvasLayer.getPadWidth(), mCanvasLayer.getPadHeight());
mCanvasLayer.addCanvasRunnable(new CanvasRunnable() {
@Override
public void onDrawCanvas(CanvasLayer pen, Canvas canvas, long currentTimeUs) {
// TODO Auto-generated method stub
mShowHeart.drawTrack(canvas);
}
});
}
}
use of com.lansosdk.box.CanvasRunnable in project LanSoEditor_advance by LanSoSdk.
the class ExecuteVideoLayerActivity method addCanvasLayer.
/**
* 增加一个CanvasLayer,
*/
private void addCanvasLayer() {
mCanvasLayer = mDrawPad.addCanvasLayer();
if (mCanvasLayer != null) {
mCanvasLayer.setClearCanvas(false);
mShowHeart = new ShowHeart(ExecuteVideoLayerActivity.this, mCanvasLayer.getPadWidth(), mCanvasLayer.getPadHeight());
mCanvasLayer.addCanvasRunnable(new CanvasRunnable() {
@Override
public void onDrawCanvas(CanvasLayer pen, Canvas canvas, long currentTimeUs) {
// TODO Auto-generated method stub
mShowHeart.drawTrack(canvas);
}
});
}
}
use of com.lansosdk.box.CanvasRunnable in project LanSoEditor_advance by LanSoSdk.
the class VideoOneDo method addCanvasLayer.
/**
* 增加Android的Canvas类图层.
*/
private void addCanvasLayer() {
if (textAdd != null) {
canvasLayer = drawPad.addCanvasLayer();
canvasLayer.addCanvasRunnable(new CanvasRunnable() {
@Override
public void onDrawCanvas(CanvasLayer layer, Canvas canvas, long currentTimeUs) {
Paint paint = new Paint();
paint.setColor(Color.RED);
paint.setAntiAlias(true);
paint.setTextSize(20);
canvas.drawText(textAdd, 20, 20, paint);
}
});
}
}
use of com.lansosdk.box.CanvasRunnable in project LanSoEditor_advance by LanSoSdk.
the class ExecuteCanvasLayerActivity method addCanvasLayer.
private void addCanvasLayer() {
mCanvasLayer = mDrawPad.addCanvasLayer();
if (mCanvasLayer != null) {
mCanvasLayer.setClearCanvas(false);
mShowHeart = new ShowHeart(this, mCanvasLayer.getPadWidth(), mCanvasLayer.getPadHeight());
mCanvasLayer.addCanvasRunnable(new CanvasRunnable() {
@Override
public void onDrawCanvas(CanvasLayer layer, Canvas canvas, long currentTimeUs) {
// TODO Auto-generated method stub
mShowHeart.drawTrack(canvas);
}
});
}
}
use of com.lansosdk.box.CanvasRunnable in project LanSoEditor_advance by LanSoSdk.
the class CanvasLayerDemoActivity method addCanvasLayer.
private void addCanvasLayer() {
if (mDrawPadView == null)
return;
mCanvasLayer = mDrawPadView.addCanvasLayer();
if (mCanvasLayer != null) {
/**
* 在绘制一帧的时候, 是否清除上一帧绘制的 内容.
*/
mCanvasLayer.setClearCanvas(false);
mShowHeart = new ShowHeart(CanvasLayerDemoActivity.this, mCanvasLayer.getPadWidth(), mCanvasLayer.getPadHeight());
/**
* 这里增加两个 CanvasRunnable
* CanvasRunnable是把当前的一段代码放到 DrawPad线程中运行的一个类. 类似GLSurfaceView的queueEvent
*/
mCanvasLayer.addCanvasRunnable(new CanvasRunnable() {
@Override
public void onDrawCanvas(CanvasLayer layer, Canvas canvas, long currentTimeUs) {
Paint paint = new Paint();
paint.setColor(Color.RED);
paint.setAntiAlias(true);
paint.setTextSize(50);
canvas.drawText("蓝松短视频演示之<任意绘制>", 20, mCanvasLayer.getPadHeight() - 200, paint);
}
});
/**
* 增加另一个CanvasRunnable
*/
mCanvasLayer.addCanvasRunnable(new CanvasRunnable() {
@Override
public void onDrawCanvas(CanvasLayer layer, Canvas canvas, long currentTimeUs) {
// TODO Auto-generated method stub
mShowHeart.drawTrack(canvas);
}
});
// 以下是测试:Canvas图层的移动缩放旋转.
// mCanvasLayer.setScale(0.5f);
// mCanvasLayer.setRotate(60);
// mCanvasLayer.setPosition(mCanvasLayer.getPadWidth()-mCanvasLayer.getLayerWidth()/4,mCanvasLayer.getPositionY()/4);
}
}
Aggregations