I’m working on an application that involves taking a photo with the camera application and then the user is supposed to select just the important part of the picture by dragging a crop rectangle over it.
My question is how to draw this crop rectangle, because it basically involves a dynamic UI environment and I’m not sure how to deal with that. Should I load the photo in OpenGL and use that to draw the rectangle or is it fine to resize a view on touch input (so about 30 times per second)?
I would just draw the rectangle in
onDraw()method of a custom view. InonTouch()set the rectangle size then callinvalidate()on the view. You can draw simple primitives of various colors and alpha values using the passed inCanvasobject. It doesn’t sound like a very complicated drawing operation, so I’d expect it to be pretty smooth.