How to crop an image taking base a rectangle in android? - 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

Related

Can we add a invisible image watermark to another image in Android? If yes then how?

I need the code to add invisible watermark to another image in Android
As the comments mentioned, Stackoverflow isn't a free coding service. I will provide you with a high level design advice from which you can implement your own code.
Invisible watermark could just be metadata. The point is to make your particular photo unique and identifiable, right? I would recommend you looking into image metadata manipulation for a simple solution.
That being said, if you are looking for some high tech stealthy watermarking, then you might be looking for pixel manipulation. You can change a few of the pixel colors so if it's compared with the original image with the naked eye, it looks identical but if compared with their base64 encoding you can see a difference. Simply create your own pattern as some sort of signature to attach to images to identify them.
Both method allows you to determine if an image is yours due to the "watermark" you leave on it.

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.

Select photo from camera and show crop option with fixed size android

my requirement is to crop image with fixed size in android.. I am getting image from gallery or camera and now want to show fixed size of crop option on that image so that user just drag the rectangle box and set anywhere on the image and save.
Please google your question before asking them on StackOverflow...
There are plenty of libraries which are doing what you want. I use this one which is stable, clear and easy to use but you'll find plenty of others just by looking on Github with a search like this.
For the fixed size, there is maybe an option directly implemented in the API of the library I proposed you (never had this requirement), but if not, you just have to change the draw method of the transparent rectangle.

How to draw a Tag on Image Bitmap?

I need help to do the following task. My task is similar to Pose (an Android application). In this application they done a amazing concept. Once you capture the image, then tap any part of the image it shows number of options to add tagline. Once you add the tag means the particular tag is added over the image. once you upload the image to server, now you can view in your profile, once you touch on the image, the tag parts are visible, then you again touch the image means the tagged icons are disappeared. How they do this think, if they are using any third party tool?.Here for your reference i added the market link of Pose application also having a video and Sample images and i also added some images kindly notice it. Kindly share you valuable suggestion to completed this task.
You can use a FrameLayout and try to position the tags over the image that way, however I would probably make a custom View, override the onDraw method and do custom drawing for all of this.

Changing image angle in android gallery view

i want my gallery application to be modified , like coverflow. but not exactly like coverflow. the images in the gallery view should be viewed in such a way that it should look like reverse letter "U" . i want to change the angle image in such a way that it has to go slightly go above the previous image so that i can achieve the reverse "U" for gallery view.
There are already widgets out there that you can consider using. I found one http://www.inter-fuser.com/2010/02/android-coverflow-widget-v2.html that looks very good, but it might not be exactly what you are looking for.
Here is another one based on the interfuser widget. http://code.google.com/p/android-coverflow/.
They claim to have improved the performance of it.
Whether you can use them as is or not, you can probably use the source as inspiration.
You can use preRotate or postRotate methods in android.graphics.Matrix. Check them once.

Categories

Resources