Android Question How to erase Accelerated Surface on all devices

WAZUMBi

Well-Known Member
Licensed User
Longtime User
It seems that on some devices I am unable to erase the AcceleratedSurface.
The background appears black.

I have tried:

acsf.color = Colors.Transparent
and in the acsf_Draw(ac As AS_Canvas) sub:
ac.DrawColor(Colors.Transparent)
But this does not seem to work on all devices.
I am assuming this has to do with whether or not the device is hardware acccelerated but
shouldn't drawing ac.DrawColor(Colors.Transparent) to the canvas still erase it?
 
Last edited:

Informatix

Expert
Licensed User
Longtime User
As Erel clears the canvas with a transparent color in his Canvas library, I replicated the same behavior in my AcSf lib but it's not a property of the transparent color (we use the PorterDuff mode CLEAR when the color parameter is 0). That being said, each time the Draw event is raised in your app, the view contains only the background (any previous drawing is cleared). So clear the background if you have one (by setting it to null) and you'll get a totally empty surface.
 
Upvote 0
Top