photo: https://imageshack.com/i/f0LwsdJPj
http://imagizer.imageshack.us/v2/xq90/540/LwsdJP.jpg
There is my draft, it is supposed to be like a "card library". My idea was to copy this "draf" and to have 1 pic.png for every card on the library, then when user drags the screen to one side, or touches the arrows it changes picture.
I have some questions. Is there any other way more efficient to do this? like having the same background for all them then changing only text inside them?
I'm doing it with canvas, i do: bitmapFactory.decode image ... then draw bitmap somewhere on the screen. Then, it's not an imageview so I don't know how to change text depending on device language.
Other solution could be something like canvas.WriteText somewhere but it doesn't exist, does it?
Last but not least, I have another problem with this "card" library. The "stars" drawn next to the numbers, should be shining or not depending on the user has the star or not. Do I have to copy an image with every combination? or is there any way to change only 1 part of the picture without building it with photoshop?
Related
I'm using Android Studio to make an app where you can create your own animal, and I want to know how I can layer pictures on clicking a button, if it can be done.
For example, suppose I want to create a teddy bear- I will first click a button to display the bear's plain body, then clicking another button should layer a transparent image of the eyes over the same body (and so on for the nose, mouth, clothes, etc.) I have attached two images as examples of which pictures should appear one over the other when their respective buttons are clicked.
IMAGE 1: This is the body of the bear that will appear when I click the button that says "body"
IMAGE 2: A transparent image of the eyes, dimensions same as the previous image. On clicking the button "eyes" this image should be overlayed onto the previous one
There are many ways of doing it, but I assume you know about OpenGL. That is the standard graphics renderer. With it you can layer as many images as you want.
For instance, you can load the images into the sampler and click-by-click you render the collection of images (given the positioning is taken care of).
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.
I have an Android app which lets the user process some photos, adding filters.
One of them is to add a datestamp to the photo, which can have only the date or both date and time.
What I need to do is, given a photo as input, even if that photo has been compressed, for example, in order to be sent through a messaging app, determine if that image has been datestamped previously or not.
Of course, I'm not asking about a complete implementation, but about a few ideas.
Right now I thought about marking some pixels of the image and then, by using HSV, try to find a similar color to the one initially set in that position.
Another approach I thought about was to try to locate the text, but my problem is that the possible positions are the four corners of the image (user chooses), and the color can be one of 27 different colors, so I cannot search for yellow on the lower-right corner of the image.
But, anyway, any idea about how to locate the date if it was always yellow and located on the lower-right corner are welcome.
Do you have any ideas?
Thank you.
I have provided a picture below so you can get a better understanding. Basically I want the user to pick a number from 1-10 which is shown by circles (Only 1 number can be picked at a time). Lets say I pick number 10, as you can see on the picture I want the circle to stroke and change the color when the number is picked (indicating to the user that the number has been chosen). After the number is picked and you press the "blue button", I want to get the value picked to do other calculations.
This is how I want it to be
I feel having a touch based circle is the best way to do it, rather than using a spinner because it take more time. Now the question is how to do this without code duplication or redundancy and how to achieve this in the best way possible. I am thinking I have to create a circle object (Possibly button shaped like circles) 10 times and put text on them, group them in array?..etc or is there a more efficient way to do this.
I'm sure there's better ways to achieve this but I suggest a simple solution as you wanted !!!
Now the question is how to do this without code duplication or redundancy?
You can create a xml file in your drawable folder and put two different oval shapes in that: defaultShape and pickedShape, Use <solid> and <stroke> tags to customize your shapes as you like, and then apply it to your buttons' background.
In order to handle the picking of your button you should implement same onClickListenerfor all 10 buttons, if one of them is picked save it to a temp variable like Button pickedButton, in your listener your check if pickedButton is not null change its background to defaultShape, and assign the new picked one to the pickedButton and then change its background to pickedShape.
Hope you find it helpful.
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.