w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Android: How to draw a rectangle on a movable image such that the drawn rectangle also moves along with the image?

In onCreate, create a new Bitmap image and a canvas for that bitmap. Use that canvas to draw the original bitmap and a rectangle to the new bitmap. Then in onDraw just draw that new bitmap wherever you want to. As a bonus you'll have very fast onDraws.

© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.