当前位置: 首页>>代码示例>>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;未经允许,请勿转载。