ondraw

Trying to get the display size of an image in an ImageView

被刻印的时光 ゝ 提交于 2019-11-26 15:49:19
I'm trying to get the real size of an image displayed in an image view. Actually my image is larger than the screen and the imageview is resizing the image to diplay it. I'm looking for this new size. I've tried to override the onDraw method of the ImageView in a custom view but I'm not getting the correct height and width... public class LandImageView extends ImageView { public LandImageView( Context context ) { super( context ); } public LandImageView(Context context, AttributeSet attrs) { super(context, attrs); } public LandImageView(Context context, AttributeSet attrs, int defStyle) {

How to draw Arc between two points on the Canvas?

帅比萌擦擦* 提交于 2019-11-26 08:03:35
问题 I have two points in the canvas, now I\'m able to draw a line between those points like this below image by using This code canvas.drawLine(p1.x, p1.y, p2.x, p2.y, paint); I want to draw the arc between two points like below image. How can I draw like this. 回答1: Finally I got the solution from this code: float radius = 20; final RectF oval = new RectF(); oval.set(point1.x - radius, point1.y - radius, point1.x + radius, point1.y+ radius); Path myPath = new Path(); myPath.arcTo(oval, startAngle

Trying to get the display size of an image in an ImageView

心已入冬 提交于 2019-11-26 04:38:27
问题 I\'m trying to get the real size of an image displayed in an image view. Actually my image is larger than the screen and the imageview is resizing the image to diplay it. I\'m looking for this new size. I\'ve tried to override the onDraw method of the ImageView in a custom view but I\'m not getting the correct height and width... public class LandImageView extends ImageView { public LandImageView( Context context ) { super( context ); } public LandImageView(Context context, AttributeSet attrs