Canvas Dynamically Modify Raster Z-Index

I am creating an Android application, and in my application I have a canvas that I draw onto bitmaps using canvas.drawBitmap (). In my opinion, the z-index on these bitmap images is set based on the order in which they stretch to the canvas. What I'm trying to understand is to draw these bitmaps, if I can dynamically change the z-index to a bitmap in order to push it to the top? This seems like a very simple problem, but I have not yet been able to find a solution.

+6
source share
1 answer

Impossible: after calling drawBitmap contents of the bitmap are displayed on the canvas, but the canvas does not store any links to the original bitmap, it only saves the results of applying the contents of the bitmap on the canvas, There is no way to dynamically say that the bitmap you painted 1 out of 50, I I want you to do this 50th bitmap and automatically redraw every other bitmap to reflect this change.

So, you will need to order drawing operations before you begin.

+6
source

Source: https://habr.com/ru/post/896159/


All Articles