本文整理匯總了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);
}