如何在位图数组列表后面设置投影?

How to set drop shadow behind bitmap arraylist?

提问人:vraj kalathiya 提问时间:10/27/2023 最后编辑:BenjyTecvraj kalathiya 更新时间:11/9/2023 访问量:29

问:

我有一个.在此 bitmapList 中,我存储了一些从图库中选择的图像,然后使用以下代码以编程方式绘制边框:Bitmap[] bitmapList;

private void setBitmaps() {

    for (int i = 0; i < Utils.bitmapListtt.length; i++) {
        try {
            Bitmap bitmap = Utils.bitmapListtt[i];
            int width = bitmap.getWidth();
            int height = bitmap.getHeight();
            Bitmap resultBitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
            Canvas canvas = new Canvas(resultBitmap);
            canvas.drawBitmap(bitmap, 0, 0, null);
            Paint borderPaint = new Paint();
            borderPaint.setColor(Utils.colors);
            borderPaint.setStyle(Paint.Style.STROKE);
            borderPaint.setStrokeWidth(Utils.progress);
            canvas.drawRect(0, 0, width, height, borderPaint);
            bitmapList[i] = resultBitmap;
        } catch (Exception e) {
            Toast.makeText(ScrapCreateCollageActivity.this, "Loading...", Toast.LENGTH_SHORT).show();
        }
    }
}

该代码绘制了一个边框,但我想在后面设置一个阴影,你能为我提供一个解决方案吗?bitmapList

java android-studio 边框

评论


答: 暂无答案