I am having a View and i have placed a background image.Taking the snapshot works fine in this case.
But i setAlpha to make background image semi transparent then snapshot becomes blackish in color depending on how much I am making it Transparent.
How to programmatically take a screenshot in Android?
having seen this link but doesn't help much with this case.
Any help?
if you put an alpha color the screen shot will get a non-color (black) mix on it, always.
If you want a screen shot, and keep your alpha, you'll probably have to remove the alpha, wait it to render on the screen, get the screen shot, and then change it back to alpha.
I know cause I've used this before in an application.
Related
In my app, I have ConstraitLayout with a gradient background. In a runtime, this ConstraitLayout can be resized. The problem I faced is that gradient drawable "isn't scaled". I will show an image to explain it better:
In the green circles, You can see that the color before and after resizing at the and of ConstraitLayout is different. Is this possible to force an app to set a gradient in the full range of colors?
The only way I have found to do it is to set ConstraitLayout background every time its changes. I think it is not the best way to do it, especially in my case when ConstraitLayout size was changing in on onTouch event, so my App has to change it so many times. But I didn't see any problems while using this solution.
so ive created a fragment for my app where a window pops up, and asks whether to take the picture from the camera or to get it from the gallery. Everthing, but the two buttons in the middle, are exactly 1 .png. This background png (that also includes the texts), has two transparancies. One in the white background (which is at about 25 percent) and one in the black background that takes about most of the screen. This opacity level was first set to 1%, now it is set to 0. The black basically doesnt even exist anymore. Yet it is almost fully black. You can see from the image i attach, that one is bearly able to see anything through. But why is that? Where does this heavy alpha channel come from?
Thanks!
When I upload my image (which has no background to begin with), it is automatically given transparent background no matter what settings I choose. I really like the "Square" shape (rounded corners) but there is way too much excess transparent background. When I see the icon on my phone it looks so small compared to Facebook for example. How can I get rid of this extra background space to make it as large as possible? Is one of my settings off?
http://reiszecke.github.io/AndroidAssetStudioFullsize/
Just click on >> Launcher icons << Full Size edit
pls mark as answer if it helped.
EDIT: only works on "bevel" and "none", I will adjust the other shapes at some point
http://www.gieson.com/Library/projects/utilities/icon_slayer/
Does the job but the an image must be provided first.
Creating the logo and background with LIG and loading the result in the gieson's icon_slayer should do it.
I have a menu screen, with an animated background layer. This background is calculated runtime, hence it is not a simple sequence of images, and it uses graphic elements that are used inside the application itself.
As soon as these graphics elements are studied to be very colourful and visible, the background animation sometimes makes the menu that is on the foreground a little confused.
So, I have to reduce the contrast of the background animation.
What is the best practice to reduce the background contrast/brightness without changing the graphic elements? (or maybe blur the background layer)
And more, would it be possible to reduce the contrast/brightness ONLY on a portion of the screen, the one below and around the menu buttons, and leave the rest of the screen as it is?
Thank you very much.
You can make the menu layer larger (think of it as a "padding" around the menu itself); if that "padding" is dark (black or close to it, depends on the effect you want to achieve, maybe even 50% gray if you only want to reduce contrast) then you can set its alpha value to something that achieves your effect of "dimming" the background. Or let the "padding" have an alpha gradient so the darkening fades out/the background fades in.
See below image and it contains some black outline and i want get only those outline. means all other part of image should be invisible.
how can i achieve this?
I'm thinking is it possible to identify a colour and invisible other colours?
You can make all other colors transparent using PorterDuffXfermode
It looks as if in your case this may not be enough, as you have black regions in the photo. One option is to change the color of the black regions to a very dark gray before adding the lines.