Android Question B4XView Snapshot does not capture elevation

Blueforcer

Well-Known Member
Licensed User
Longtime User
If i request a snapshot of some panels with elevations

B4X:
Dim root As B4XView = Activity
root.snapshot

From this
1645479911272.png


Results in this:

1645479975588.png


Also the fontcolors are not the same.

How can i get a snapshot of the actual looking activity?
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
B4XView.Snapshot asks the view to draw itself on a canvas.
The shadows are indeed missing. I can only guess that the shadows are not part of the views tree and are added as a special effect in a different way.
There is no other way to capture a view, other than taking a real screenshot which has many restrictions.
 
Upvote 0

Blueforcer

Well-Known Member
Licensed User
Longtime User
B4XView.Snapshot asks the view to draw itself on a canvas.
The shadows are indeed missing. I can only guess that the shadows are not part of the views tree and are added as a special effect in a different way.
There is no other way to capture a view, other than taking a real screenshot which has many restrictions.
Thanks, as I read on other forums it's because Shadows (Elevation In API25+) are hardware accelerated and is rendered outside of the views pipeline and therefore are not available for caching at the view level.

Too bad I wanted to use the transition effect.
 
Upvote 0
Top