The problem is to make a circle which has more then one semi circles and having some text on that emi circle depends upon my text input array. how to make this in canvas.
You can use great MPAndroidChart library.
It supports circle graphs.
Related
I would like to draw in Android something like shape in the picture. I have used Path.drawArc but I can't draw two arcs which are parts of cirlces with the same center. Another problem is how to draw two lines which connect these arcs. In iOS I would use bezierPathWithArcCenter:radius:startAngle:endAngle:clockwise:
How to draw shape like in the sketch?
here is simple example using canvas and bitmaps, try this example and get some idea for your requirement. image cropping and transparent
I am trying to draw something like this http://www.laviny.sk/themes/hzs/images/pocasie/r/r2.png using android XML shape. It is one big triangle (45° on bottom) and one smaller triangle on top of it. I am planing on using it on image like this http://www.laviny.sk/themes/hzs/images/pocasie/r/r0.png. I know that I could use simple png image of this but I want to set its color programatically so thats why I am trying to use android shape.
Is this too complex to be drawn by shape? If not can you please try to guide me a bit because I really dont know how should I approach this problem.
Thanks in forward
Layer-list should be able to do that. The other way is to extend ImageView and draw what you like on a canvas within the onDraw method.
I need to create the painting application for the kids where kid can colour inside the black bordered sketch of any image
But, I am struck with the problem,that colouring can come outside the black bordering of the image...which i don't want to.Please guys help me to find out how to restrict the colouring by user within the black border of sketch
Also, I want that no colour should cover the black border.it should be inside the border.
I can post my code if required.
Look at Canvas clipPath and use the clipping built in to android to limit the 'coloring' of the kid/user to the regions you specify. You can then draw your objects as layers, kid/user colored layer on bottom, your sketch on top.
Finally..i have implemented it using mask bitmap and right usage of Portet.Duff mode
So I'd like to be able to draw a circle where I can specify the amount of circle drawn as shown in the following diagram.
AS an opengl newbie I'm not really sure how to approach this.. I've previously drawn full circles using GL_TRIANGLE_FAN
You already know how to draw a circle using a triangle fan. Now you just have to calculate the angles of the cutoff corners, use those as the beginning and end of the arc and place the hub of the triangle fan at the middle of the cutoff edge.
you could use a glScissor test to cut off the parts of the circle that you don't want.
http://www.khronos.org/opengles/sdk/1.1/docs/man/glScissor.xml
I have created rectangle shapes using onDraw method, filled with single colors. Now I have a requirement to add gradient effects to those rectangles. Now I have to fill each rectangle with multiple colors(i.e gradient effect). Could some one suggest me the way to do that. Any response would be great.
thanks in advance.
See the LinearGradient class in the Android graphics library.