Good day guys.I want to make the bottom part of my own image an curved line.Not to talk back and forth here is an image which i want to get into the application.
Important to notice that i have reached 10th result of the google and everything i came up was only some curved image not in my desired way,the whole image was curved and the lines of 4 parts were connected to single one.
So basically i want the image to be as rectangle as it comes from server and only curve the bottom part of a bitmap.Is that even possible?
Noticae the bottom line is curved,that what i want to achieve,and rest parts are rectangle.Thank you for your time.
If you are trying to change the image itself, photoshop or any editing tool is the right way to do it. besides if you are getting the image from a server somewhere then getting the image adjusted from the server, instead of modifying it on the client side(o your app) has lot of benefits.
But, if want to change the look not the image itself, then that could be achieved by creating a custom image view like answered here.
You can also use a card view hold your image view to achieve some curves, although i don't think that would be efficient or satisfactory for your case.
Sometimes, editing the image in Photoshop is the right way. This can save your android app CPU time.
Related
I like the style iOS 7 has used for their Notification and Music popover like below.
So, I try to implement this thing in Android. After doing some search, I achieved how to do that. What I have tried is following.
1) First I take a root reference of the View and take a snap of it using getDrawingCache() function of View.
linearLayout.buildDrawingCache();
SoftReference<Bitmap> bitmap = new SoftReference<Bitmap>(
Bitmap.createBitmap(linearLayout.getDrawingCache()));
linearLayout.destroyDrawingCache();
2) I take the position relative to its parent and cut the image as per requirement.
SoftReference<Bitmap> temp = new SoftReference<Bitmap>(
Bitmap.createBitmap(bitmap.get(), 0,
(parentHeight - childHeight), childWidth, childHeight));
3) I make that bitmap image blur with some algorithm. ( I use Fast Bitmap Blur For Android SDK fastBlur effect )
4) set it in the overlay view.
imageView1.setImageBitmap(Utils.fastblur(temp.get(), 8));
But my problem is it takes time to take a snap then giving blur effect and cutting image and then i got final result. While iOS has very fast blurring process like when drawer is coming from bottom, it immediately blur the screen which is behind it.
Is there any other way to achieve that? Because using my scenario, i can't take every second snap of screen and do all process 1 to 4 every second on every move of drawer.
http://nicolaspomepuy.fr/blur-effect-for-android-design/
I don't know if you have seen this link, but check it out. It talks about how blur effects can be achieved in around 200ms.
PS: check out the comments as well !
Ok so if I understand your problem correctly is that is you have a drawer mechanisme that you need to update the blurred image every pixel the drawer has moved?
Then the solution to your problem would be to blur the screen one time and use this image together with some fancy algorithm to show/hide and position that image so that it seems that the drawer will blur instantly but in actually what's happening is that the image was already generated.
You just show more or less of the image to create the effect.
Don't know if I'm making sense or if I even understand your question.
I need to put together a complete image, as seen here. Each piece of the segmented tree is an individual image, but I am unsure about how I should put the pieces together efficiently with spacing in between. I've thought about stacking the images on top of each other one at a time within a canvas, but I have my doubts as to whether this is the approach that I should take. Is there a different type of container I should use or a better method of accomplishing the same task?
EDIT: just to clarify, I need to assemble the image programmatically, beginning with the base segment and eventually ending with the top segment.
If you use a program like Gimp, you can added each image as a layer, then move the layers around correctly. I'm not quite sure how you want to represent the space between the segments, transparent?
Any way after you have your image assembled the way you want you can either merge the layers or save it to a format that will flatten out your images.
I'm not sure if you want your image to be able to stretch at all or not. If so, you can save it as a .png file and then use draw9patch or equivalent to add in stretching segments. Also I'm not sure if you have to support multiple drawable sizes, if so I have a free Android app, DP Image Calculator on Google Play that might help. Just remember start with the highest resolution and work you way down to the smallest.
Hope this helps. If you have more question let me know. Have a great day.
I want to create an image auto scrolling for an outer-space type of game. To make it more exact, I want to load 2 background image that uses a single image occupying the whole screen and auto-scroll it alternatively to create an animation that the background image is moving. Don't get confused with auto scrolling and and shifting to another image automatically. I really meant auto scrolling like moving background using 1 image.
I did some research but what I saw are segments of java codes that made me confused. If possible can anyone provide me an example? From loading the image from xml (should I use an imageview with this? or just set the background image of the layout?) and how I should process it in java code to make an image autoscrolling.
Any ideas guys? Thanks! Sorry for asking too much.
User can select some images to the screen, and be able to select/drag/move/zoom/rotate each image. When an image is selected, it will have a blue border. And user can also bring an image to the front or background.
Here is sample picture in the following: there are two images(girls) on a star-background. The top one has been selected(it has a blue border).
I don't know have to implement it. For several days of learning, I can now drag/move/zoom/rotate a single image(inside an imageview, and scaled by matrix). But I don't know how to handle multi-images.
I want to know:
Is it still a good idea to use ImageView(for each image), or what classes should I use?
How to implement the orders? (so I can bring them to front or background)
How to determine which image has been selected
How to find and draw the border of selected image?
For now, I just know how to use ImageView, but I'm not sure if I can use it to implement this task. Please give me some advices, thanks !
Drawing everything directly onto a Canvas is one way of doing it. There is an article that covers the basics of using a Canvas. You can read it HERE
There is one major downside in doing this - you have to handle all the input events by yourself. The API won't tell you which image has been clicked, or dragged. You'll have to implement that by yourself.
can anyone let me know how to keep an image on top of other image. If we select a portion of the top image it should display the below image portion.
Please share the samp
Thanks in advance.
-pavan
I'm not sure if this would completely answer your question... but firstly, images shouldn't really ever overlap in a LinearLayout. If you're using a RelativeLayout, they definitely can overlap, and the image on top will be whatever was loaded last in the XML.
If I understand what you're attempting to do - kind of transparency (so to speak) of the top image so that portions of the bottom image are displayed along with portions of the top image ... I do things like that all the time by overriding the onDraw() method on my View to handle the image painting myself. There's allot of examples on the net for this - simple stuff.