upload image and draw rectangles using only one ImageView - android

Can I upload a picture (in a ImageView) and draw rectangles using the canvas in the same ImageView? all the examples I've seen so far used two. I wonder if you can use only one? if so, how?

If you are new to android.
Open android studio, .
File ->New->import Sample ,
search for image.
Choose basic render script, this will give you basics of image handling.
However for your usage, you can simply create a view with border and add imageview inside it.

Related

Crop multiple portion from one image

I have a image from which I need create multiple smaller images by drawing rectangles on the parent image, using opencv I know how to draw a rectangle and cut it from the image using Mat and Rect, but the main problem I am facing is that the image is entered through user input and the user can choose to select any portion he/she wants to crop out, so everything needs to be dynamically operated.
The attached image will clarify things a bit
I am new to opencv with android so any help is appreciated.
also if one can provide solution without using opencv is also welcome.

How to crop an image taking base a rectangle in android?

I'm implementing a custom camera, in the layout I have a rectangle inside the layout, where the user have to put his card, so after take the photo i need crop the picture, taking the reference the rectangle.
Any suggestion of how to do this?
Possibly you can use a library that do this on your behalf.
If you are not fully satisfied and need to understand how it works the process you can read the API. I do not know exact if you mean the selection have to be a rectangle of you are referring to the rectangle of your customer view where the card should fit, in the first case the library from Arthurhub should be enough
if you want to implement from scratch, I guess you need to use Matrix
enter link description here
https://github.com/ArthurHub/Android-Image-Cropper

android: scale ImageView like telegram app

How can I implement telegram app scaling ImageView effect?
telegram has rounded images for contacts. if I touch it in a amazing animation it gets scale and fill the screen. in animation transition image convert from circle to rectangle smoothly. I cannot find anyway to do this. I found libraries like shapedImageView but I have trouble with converting circle to rectangle smoothly.
my main challenge is the animation effect.
The source code of telegram is available on github, so you can check it and see, how they implemented that.
Maybe it is also possible to achieve this effect with material transition animations, if you want to open picture in another activity/fragment. Have a look at this library, for example: Material-Animations. I think you could try using shared elements.

Clickable resizable buttons on image android

I am trying to create an application which has a map image in it.
I want to add some areas (or buttons) to it so that when you click them the bubbles with information will appear.
I am new in android programming so asking to explain a bit how to implement it?
Also i need an image to be re-sizable just like a real map.
So should i attach the buttons to specific places on image and how to do so that the buttons will be connected to it when i re-size an image?
Which image type is better to use for this purpose? I heard that SVG would be better but i couldn't even add svg image to an application.
I appreciate any helpful advice.
For your problem you can use this:
http://catchthecows.com/?p=113
I need something similar, but the click on the image should change the content of that part as well.
When I find or implement the final solution I can post it here.

Create custom Imageview component that has a custom picture frame

I would like to build a custom component (extending from ImageView I guess) that display an image inside a frame specified by the user (the frame is a custom image) with inner rounded corners (Pinterest user icon like).
I started finding how to compose two bitmaps but it is a difficult matter so I am wondering if there is some opensource component/tutorial to better understand how to achive it.
The frame picture is a nine-patch png (I didn't understand how to load and scale it properly into a bitmap).
Thanks
Have you checked out this
Seems like it does the job, although I'm not sure how to implement.

Categories

Resources