Blur effect Android - android

I am new in android development. I want to make blur background layout. I read some blog but I didn't get that I want.
I want to make layout like this: http://postimg.org/image/azjkgbl3l/
Suggest me some blogs or how to do this.
Thank you.

There are some ways to do this,For API < 14, you could use the flag WindowManager.LayoutParams.FLAG_BLUR_BEHIND, but it's been deprecated and built-in blurring is no longer supported on higher APIs.So you can create a blurred bitmap and set it as background for the page. Refer the following links for more details.
Blur effect like in the app Etsy?
http://nicolaspomepuy.fr/blur-effect-for-android-design/
Android, how to blur/glass/frost current activity

Related

How to make image coloring in Android

I'm new to Android Graphics and would appreciate if you can advise an algorithm to color particular part of image with outlines. I would like to create similar to this application.
I should be able to fill in parts of the image with colors, or use freehand tool to paint, but it should not go outside the outlines.
Should I use any image recognition tools to track black pixels for example?
I can also use predefined images only. I know I can convert each part of it into vector format. Will it be helpful?
Any tutorial references or example code would be highly appreciated.
You could look for connected-component-labeling. It basically assigns a label to each pixel where the label depends on the color of the neighbour. A description and implementation (though not in Java) can be found here: http://www.codeproject.com/Articles/336915/Connected-Component-Labeling-Algorithm. An implementation in java might be found here (https://github.com/klonikar/connected-components-labeling). I didn't check it though.
When you selected the pixels that you need, you can color them as described here: how to change the color of certain pixels in bitmap android

SVG image not displaying using the standard code

I am using the standard code stated in the example of the library of https://code.google.com/p/svg-android/wiki/Tutorial, here is my OnCreate method :
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_test);
ImageView imageView = (ImageView)findViewById(R.id.imageViewTest);
// Set the background color to white
imageView.setBackgroundColor(Color.GRAY);
// Parse the SVG file from the resource
SVG svg = SVGParser.getSVGFromResource(getResources(), R.drawable.android);
//Get a drawable from the parsed SVG and set it as the drawable for the ImageView
imageView.setImageDrawable(svg.createPictureDrawable());
}
I am not able to add the layout code here, so sharing it in this doc: https://docs.google.com/document/d/1fbi3B_hAYUh_C2IwPfInvZ-BG2bgsa4pZoJKj8NBT9o/edit?usp=sharing
It does not give any error but it also does not display the image.
I was earlier getting doubts that the image is incorrect, then I used the one in the same example.
Yet it is not displaying the image nor giving any error.
Please suggest how to debug further.
On newer devices have hardware rendering turned on by default so you need to explicitly turn on software rendering.
use this after your code:
imageView.setLayerType(View.LAYER_TYPE_SOFTWARE,null);
Your problem is almost certainly hardware acceleration. You may need to set the View LayerType to software mode.
See Having issue on Real Device using vector image in android. SVG-android
If that doesn't fix it, then it may be an issue with svg-android, which can have trouble rendering correctly anything other than simple SVGs. You might have better luck with my library AndroidSVG.
The best practice for SVG on Android is going to be to use a tool to convert your SVG to PNG at the size(s) you're interested in. Existing SVG support for Android is not comprehensive of what you're likely to find in an SVG file, and even if it were, the support is not built into the OS so using them directly is out of source .
If the library you're working with can process the SVGs you have well, you can make it work for every icon but not through the standard Android API; you'll need to create a custom view. Around months ago I used the library you linked and at that time it had trouble with many SVGs I had created in Inkscape or downloaded from various places. Perhaps its support has improved since then, but I recommend testing it with the exact SVGs you plan to use before you write a lot of custom code for it.

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.

implement photoshot-like overlay on android

I have 2 images and I want to overlay them and get the same effect as in photoshop's "overlay". Overlay porterduff exist in PorterDuff'd documentation but I guess not for android 2.2.
any idea on how to implement this?
thanks
They have added it to the PorterDuff.Mode enum, but im not sure from what api version, im pretty sure it's >2.2.api doc
You can just use LIGHTEN and darken your dst image to achieve a similar effect :)

inserting picture in android

I am new to android.I want to insert a pictue (which is in c: drive) using image view control. pls give some idea related to it.
this covers that in detail. let us know if you have specific questions.
http://developer.android.com/guide/topics/graphics/2d-graphics.html#drawables-from-images
Displaying an image in an ImageView is quite simple. Check out this family of files from API Demos:
ImageView1.java
image_view_1.xml
ImageView1.java is quite simple: it just loads the xml layout file. You can change the #drawable/... references in image_view_1.xml to point to your own resources and see the effects you get with different styles of ImageView.
I recommend exploring the API Demos code, as it covers a large portion of the Android framework and will give you an idea about what is possible.

Categories

Resources