From 9daccbb084ec9f8d7e72bf383590f97099b0f01a Mon Sep 17 00:00:00 2001 From: r-ca Date: Mon, 25 Dec 2023 12:13:22 +0900 Subject: [PATCH] =?UTF-8?q?=E5=B1=B1=E3=81=A3=E3=81=BD=E3=81=84=E3=82=82?= =?UTF-8?q?=E3=81=AE=E3=82=92=E6=8F=8F=E7=94=BB=E3=81=99=E3=82=8B=E3=82=88?= =?UTF-8?q?=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DebugMenuFileManagerTesterFragment.java | 32 ++++++++++++++++--- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/feature/debug/src/main/java/one/nem/lacerta/feature/debug/DebugMenuFileManagerTesterFragment.java b/feature/debug/src/main/java/one/nem/lacerta/feature/debug/DebugMenuFileManagerTesterFragment.java index ddc021df..f27bfe3a 100644 --- a/feature/debug/src/main/java/one/nem/lacerta/feature/debug/DebugMenuFileManagerTesterFragment.java +++ b/feature/debug/src/main/java/one/nem/lacerta/feature/debug/DebugMenuFileManagerTesterFragment.java @@ -71,13 +71,37 @@ public class DebugMenuFileManagerTesterFragment extends Fragment { FileManager fileManager = fileManagerFactory.create(deviceInfoUtils.getExternalStorageDirectory()); fileManager.createDir("test"); fileManager.changeDir("test"); - Bitmap bitmap = Bitmap.createBitmap(100, 100, Bitmap.Config.ARGB_8888); + Bitmap bitmap = Bitmap.createBitmap(1000, 1000, Bitmap.Config.ARGB_8888); // Bitmapに描画処理を行う Canvas canvas = new Canvas(bitmap); - Paint paint = new Paint(); - paint.setColor(Color.RED); - canvas.drawCircle(50, 50, 50, paint); + // 大きな山の形状を作成 + android.graphics.Path bigMountainPath = new android.graphics.Path(); + bigMountainPath.moveTo(100, 800); // 左下の開始点 + bigMountainPath.lineTo(500, 300); // 頂点 + bigMountainPath.lineTo(900, 800); // 右下 + bigMountainPath.close(); // パスを閉じる + // 山の描画設定 + Paint mountainPaint = new Paint(); + mountainPaint.setColor(Color.GREEN); + mountainPaint.setStyle(Paint.Style.FILL); + + // 大きな山を描画 + canvas.drawPath(bigMountainPath, mountainPaint); + + // 小さな山の形状を作成 + android.graphics.Path smallMountainPath = new android.graphics.Path(); + smallMountainPath.moveTo(400, 800); // 左下の開始点 + smallMountainPath.lineTo(650, 400); // 頂点 + smallMountainPath.lineTo(900, 800); // 右下 + smallMountainPath.close(); // パスを閉じる + + Paint smallMountainPaint = new Paint(); + smallMountainPaint.setColor(Color.parseColor("#006e54")); + smallMountainPaint.setStyle(Paint.Style.FILL); + + // 小さな山を描画 + canvas.drawPath(smallMountainPath, smallMountainPaint); fileManager.saveBitmapAtCurrent(bitmap, "test.png"); });