當前位置: 首頁>>代碼示例>>Java>>正文


Java Canvas.drawRGB方法代碼示例

本文整理匯總了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();
  }
 
開發者ID:wjchen,項目名稱:AndroidUvcCameras,代碼行數:17,代碼來源:CameraPreviewV4L.java

示例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);
    }
}
 
開發者ID:pontusstjerna,項目名稱:SnakeWear,代碼行數:29,代碼來源:Renderer.java

示例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);
    }
 
開發者ID:StringMon,項目名稱:homescreenarcade,代碼行數:8,代碼來源:GameSurfaceView.java

示例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();
}
 
開發者ID:wjchen,項目名稱:AndroidUvcCameras,代碼行數:16,代碼來源:CameraPreviewUVC.java

示例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);
}
 
開發者ID:GuepardoApps,項目名稱:LucaHome-MediaServer,代碼行數:12,代碼來源:GameState.java


注:本文中的android.graphics.Canvas.drawRGB方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。