Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OOM addLogo() Bitmap bitmap = Bitmap.createBitmap(srcWidth, srcHeight, Bitmap.Config.ARGB_8888); #137

Open
LiWeiQiangAndroid opened this issue Mar 8, 2021 · 4 comments

Comments

@LiWeiQiangAndroid
Copy link

这里会发生OOM

@LiWeiQiangAndroid LiWeiQiangAndroid changed the title OOM addLogo = Bitmap bitmap = Bitmap.createBitmap(srcWidth, srcHeight, Bitmap.Config.ARGB_8888); OOM addLogo() Bitmap bitmap = Bitmap.createBitmap(srcWidth, srcHeight, Bitmap.Config.ARGB_8888); Mar 8, 2021
@jenly1314
Copy link
Owner

你生成多大的二维码?

@LiWeiQiangAndroid
Copy link
Author

200*200 单位dp

@jenly1314
Copy link
Owner

jenly1314 commented Mar 15, 2021

生成带logo的二维码也就创建两张位图,感觉不至于,不知道你传的logo图片有多大?你可以先尝试使用 Bitmap.Config.ARGB_4444

Demo中生成的二维码宽高就 400 * 400了,后续我抽空生成更大的二维码试下。

@LiWeiQiangAndroid
Copy link
Author

java.lang.OutOfMemoryError

Failed to allocate a 1440012 byte allocation with 877928 free bytes and 857KB until OOM

看上报的异常都是在后台的,系统 android5.1-7.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants