Best way to scale a bitmap in a view?
Greets,
I开发者_开发知识库 have a custom view which is drawing some bitmaps on screen. I want to scale the bitmaps depending on some sensor data. Can anyone suggest to me the best way (performance wise) to scale the bitmaps.
Right now I'm creating the bitmaps in the constructor of the view but if I start to scale it in the onDraw method I believe I'll just be re-drawing the bitmaps (Which will be a memory / cpu hog).
Any suggestions for what I should do.
Can you do it in response to the sensor data as opposed to in onDraw? I was doing something similar (too much work in onDraw) and I needed to move the logic somewhere that I would be doing it a lot less.
How are you receiving your sensor data (SensorEventListener?).
精彩评论