本文整理汇总了Java中android.graphics.Canvas.drawRGB方法的典型用法代码示例。如果您正苦于以下问题:Java Canvas.drawRGB方法的具体用法?Java Canvas.drawRGB怎么用?Java Canvas.drawRGB使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.graphics.Canvas
的用法示例。
在下文中一共展示了Canvas.drawRGB方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: surfaceCreated
import android.graphics.Canvas; //导入方法依赖的package包/类
@Override
public void surfaceCreated(SurfaceHolder holder) {
Canvas canvas = holder.lockCanvas();
if (canvas != null) {
canvas.drawRGB(0, 0, 0);
holder.unlockCanvasAndPost(canvas);
}
if (cameraHandle == 0) {
V4lJni.setRotate(mCameraId, 2); // 0��ʱ��90�ȣ� 1˳ʱ��90�ȣ� 2����ת, 3��ת180��
cameraHandle = V4lJni.openCameraExt(mCameraId, 1280, 960, 0);
}
// ������Ƶ�߳̿�ʼ
this.shouldStop = false;
this.mainLoop = new Thread(this);
this.mainLoop.start();
}
示例2: render
import android.graphics.Canvas; //导入方法依赖的package包/类
public void render(Canvas canvas) {
if (!game.isGameOver()) {
canvas.drawRGB(0,0,0);
paint.setColor(DARK_GRAY);
paint.setStyle(Paint.Style.FILL_AND_STROKE);
drawBackground(paint, canvas);
paint.setColor(DARK_ORANGE);
paint.setStyle(Paint.Style.STROKE);
drawBackground(paint, canvas);
drawHead(canvas);
paint.setColor(GRAY);
paint.setStyle(Paint.Style.FILL_AND_STROKE);
for (SnekPiece piece : game.getSnake().getBody()) {
drawSnekPiece(piece, canvas);
}
float foodX = game.getFoodX() * scale + paddingX;
float foodY = game.getFoodY() * scale + paddingY;
paint.setColor(CYAN);
paint.setStyle(Paint.Style.FILL_AND_STROKE);
canvas.drawRect(foodX, foodY, foodX + scale, foodY + scale, paint); //food
drawScore(canvas);
} else {
showGameOver(canvas);
}
}
示例3: drawGame
import android.graphics.Canvas; //导入方法依赖的package包/类
public void drawGame(Canvas canvas) {
canvas.drawRGB(0, 0, 0);
drawMaze(canvas); // draw updated maze
drawPacmon(canvas);
drawGhost(canvas);
// drawScore(canvas);
}
示例4: surfaceCreated
import android.graphics.Canvas; //导入方法依赖的package包/类
@Override
public void surfaceCreated(SurfaceHolder holder) {
mUsbMonitor.register();
mUsbMonitor.requestPermission(getCamDev(mCameraId));
Canvas canvas = holder.lockCanvas();
if (canvas != null) {
canvas.drawRGB(0, 0, 0);
holder.unlockCanvasAndPost(canvas);
}
this.shouldStop = false;
this.mainLoop = new Thread(this);
this.mainLoop.start();
}
示例5: Draw
import android.graphics.Canvas; //导入方法依赖的package包/类
public void Draw(
@NonNull Canvas canvas,
@NonNull Paint paint) {
canvas.drawRGB(20, 20, 20);
paint.setARGB(255, 255, 255, 255);
drawBall(canvas, paint);
drawBoards(canvas, paint);
drawPoints(canvas, paint);
drawInfo(canvas, paint);
}