public static Bitmap drawBackground(int cellSize, int height, int widht) {
		Bitmap bitmap = Bitmap.createBitmap(widht, height, Config.ARGB_8888);
		Canvas cv = new Canvas(bitmap);
		Paint background = new Paint();
		background.setColor(BACKGROUND_COLOR);
		cv.drawRect(0, 0, widht, height, background);
		background.setAntiAlias(true);
		background.setColor(LINE_COLOR);
		for (int i = 0; i < widht / cellSize; i++) {
			cv.drawLine(cellSize * i, 0, cellSize * i, height, background);
		}
		for (int i = 0; i < height / cellSize; i++) {
			cv.drawLine(0, cellSize * i, widht, cellSize * i, background);
		}
		return bitmap;
	}

其中 :public static int BACKGROUND_COLOR = Color.argb(255, 128, 128, 128);

          private static int LINE_COLOR = Color.argb(255, 154,154,154);


 

相关文章:

  • 2022-01-25
  • 2021-11-22
  • 2022-12-23
  • 2022-12-23
  • 2021-11-20
  • 2022-12-23
  • 2021-04-04
猜你喜欢
  • 2021-07-15
  • 2021-10-09
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-15
相关资源
相似解决方案