sorry for bad English,
I want to implement the koreakoe song.
and i have 1 video for that.
so i can take each frame from MediaMetadataRetriever class in android.
in Bitmap format. and each bitmap contain one image and some text.
So my question is how to get this text on image and after remove this text from image or highlight each word on current image.
i have no such code that
please give me suggestion.
Please see the below image for example..
Then after
OR
if you some clarification please ask me.
Thanks in advance.
If you see some text in an image, that's not a separate object you can manipulate (i.e.: removing or highlighting a word).
Because that text is not a string. It's part of the bitmap itself.
It's a bunch of colored pixels over a bunch of colored pixels.
Thereafter, you can't easily remove it if not using a graphic editor or some AI techniques.
[EDIT]
A tricky solution would be to COVER the text with something else.
I.e.: a textView with an opaque background. There you will put YOUR text.
This can be easily achieved, by using a RelativeLayout.
I said it's TRICKY. Probably it's not the best visual solution, but it may help you solve the urgency.
[EDIT 2]
Another tricky solution would be to CUT the text potion of the image.
I.e.: you CROP the image at a specified amount of pixels.
Again, I said this is TRICKY, too. Probably it's not the easiest way, but it may result in a better visual rendering, allowing you to use a TRANSPARENT background for your text.
I think you should use an image without text and then lay the text over the image using a TextView. I hope it is then clear how to manipulate the text without changing the image.
As Bob Malooga already stated, there is no easy and flawless way to remove text that is actually part of the bitmap, so you should separate the image from the text.
Related
On Android, I have a header with a background image (Random image according to API).
On this header I have texts with some data. My text is every time black but sometimes image is black too. So, we can't see the text.
I'm looking for library or snippet for resolve this problem.
Thanks.
You can use the palatte library for this. Please see the following:
https://developer.android.com/reference/android/support/v7/graphics/Palette.html
https://developer.android.com/training/material/palette-colors.html
I encoutered this problem months ago and was not really sure how to approach it. First of all you need to use a Layout where you can put View over View for example Relative or Frame. After that you need to make the ImageView thats behind the TextView to be a little bit Lighter or Darker (like a shade) at the place of your TextView so you can choose a color for your text which will always be readable since the shade will be in contrast with the text. What you can do is put something behind the TextView and the ImageView which will be Light or Dark and make the ImageView a little bit transparent using set.alpha(int) if i remember correctly. So at this point you will have transparent image with a light or dark rectangle behind it. It will be visible that the part where you have the rectangle is darker/lighter. Then you put your TextView there with contrast color to the Rectangle and you will always be able to see it. It is kind of complicated, but it will work. Hope it helps.
I think palatte is not available for android. So glide will be a better option. Link
I'm going to make an app for which I need to know how does android split the text in it's TextView.Because of the splitting the text doesn't go out of the window it retains in side a bound.
The help what I need is like the image
In the image the text didn't overlap with the triangle. So I need a sample code spinnet which will help me to do that. Or idea to how to do it will also help me.
One of the easiest way, I think - split one TextView on several ones (for example - 3, or more if you need precise approximation).
I've been working on this problem for 2 days now. What I'm trying to achieve is to make a bitmap fill the complete non-transparent background of a 9patch drawable (a speech bubble in this case).
Instead of this
I want something like this
(Yes, bad photoshopping, but serves its purpose.)
Is that even possible? I cannot provide any code, as I don't have any that would make my problem more clear. Sorry about that.
Regards,
D.
OK, I've read a lot of tutorials and even downloaded some examples, but for the love of Stackoverflow, I can't get my image to stretch like I want it to and I'm hoping that someone can help me out here.
I create an image that is to be the background of a button object in Android. Here is the image:
Now, I'd like for it to stretch to the desire size of the button, whether the button is 50x50dp or 200x100dp. One thing I don't want is the border to stretch as it will look distorted, so I want to specify not to include the border, but stretch everything else to the desired size of the button.
Can someone please show me where the black lines need to go in order to achieve my goal? Do I have to change my original image in order to achieve my goal?
Thank you in advanced.
David
It's very simple using this tool Android Asset Studio: Simple 9-Path Generator. Although no matter how you do it you will have stretching and distortion due to the textured (non-patterned) background. I would stay away from that style both personally and for usability.
I've been asked to create an app that allows the user to fill in areas of an image with different colours, very similar to a childs "colour by numbers" game.
I'm not sure how to delineate the areas of the image and make them selectable. Please could someone give me an idea of a good way to go about doing this in Android.
Thanks
It's a kind of a tricky task... There's probably a better way to implement it, but here's my first thought:
You could pre-break the image into separate segments before the app runs.
As far as I know the only type of View you can create is a rectangle. But you can create many small rectangles to fill in parts of your image. Then you can get the clicks on those little areas and make a corresponding segment of your image:
int color= res.getColor(R.color.my_color);
image.setColorFilter(color, Mode.SRC_ATOP);
Hope this helps!
If you don't mind writing some NDK code, you could try OpenCV's cvFloodFill method. Otherwise you have to implement one of the image segmentation methods.