gpt4 book ai didi

android如何在canvas半透明上绘制位图

转载 作者:IT王子 更新时间:2023-10-28 23:34:56 31 4
gpt4 key购买 nike

我尝试修改 Paint 变量,但没有成功 - 如何使位图显示为“半透明”?

最佳答案

canvas.drawColor(Color.WHITE);   
BitmapDrawable bd = (BitmapDrawable) getResources().getDrawable(R.drawable.loading);
Bitmap bm = bd.getBitmap();
Paint paint = new Paint();
paint.setAlpha(60); //you can set your transparent value here
canvas.drawBitmap(bm, 0, 0, paint);

关于android如何在canvas半透明上绘制位图,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7438537/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com