How to set image overlay on another image on specified X and Y position on main image?
开发者_运维百科how to set small images on main image in specified x and y position , my main image also zoom functionality so if user zoom image than the another all image also set specified x and y position as per zoom level. please any one suggest which step follow for this ....
In such cases i suggest extending the ImageView class and overriding the onDraw()
method. There you can call super.onDraw()
first which will draw your underlying image as you would expect it from the ImageView.
Now you draw whatever you want ontop of it (and you can also care about the scaling then).
Are you familiar with inheritence and overriding in java or do you need more detailed information?
You can try matrix.setTranslate(float dx, float dy)
to do position chaning, or u can try view.offsetLeftAndRight(int offset)
functions.
Hope it will be helpful.
BTW, matrix can only works after api level 11
精彩评论