Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ```
- private Bitmap loadBitmapFromView(View v) {
- int specWidth = View.MeasureSpec.makeMeasureSpec(900 /* any */, View.MeasureSpec.EXACTLY);
- v.measure(specWidth, specWidth);
- int questionWidth = v.getMeasuredWidth();
- Bitmap b = Bitmap.createBitmap( questionWidth, questionWidth, Bitmap.Config.ARGB_8888);
- Canvas c = new Canvas(b);
- c.drawColor(Color.WHITE);
- v.layout(v.getLeft(), v.getTop(), v.getRight(), v.getBottom());
- v.draw(c);
- return b;
- }
- ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement