florent37 / florent37/ShapeOfView
Big Drawing Bug
- Dominant language
- Java
- Stars
- 3.2k
- Forks
- 400
- PR merge metrics
- No merged PRs in 30d
Description
Unfortunately when you try to create a Bitmap from the View it wont show the correct View.
How it looks when added as a view:

How it looks when taking a bitmap from this view:

The method you use to create the bitmap is totally arbitrary:
` DisplayMetrics dm = getResources().getDisplayMetrics();
v.measure(View.MeasureSpec.makeMeasureSpec(dm.widthPixels, View.MeasureSpec.EXACTLY),
View.MeasureSpec.makeMeasureSpec(dm.heightPixels, View.MeasureSpec.EXACTLY));
v.layout(0, 0, v.getMeasuredWidth(), v.getMeasuredHeight());
Bitmap returnedBitmap = Bitmap.createBitmap(v.getMeasuredWidth(),
v.getMeasuredHeight(), Bitmap.Config.ARGB_8888);
Canvas c = new Canvas(returnedBitmap);
v.draw(c);
`
or something like:
` setDrawingCacheEnabled(true);
buildDrawingCache();
getDrawingCache();
`
It really doesn't depend on the way you use to create the screenshot.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.