I want to draw a rectangle on the map. The rectangle has a button and a shape and a text.
I can draw a rectangle on the map but when i move my finger on the screen, the size of rectangle changed.Why? I don't know how can i put a button and text and shape on the map. Please help me.
Related
How would you draw something like this programmatically in a ondraw method? I know how to draw lines or squares, but to have an image inside a squarebox that has an arrow, is kind of confusing for me
Thank you
Just break the drawing up in different elements:
a gray box
a white rounded rectangle
a white rectangle
a blue rectangle
a blue rounded rectangle
a blue triangle
a red heart (I would just try to find a font with a nice heart)
the text in white.
Draw it all to the canvas in this order and you are fine.
Is it possible to have a pulsing animation, like the sonar pulsation, on a circle that I have drawn in a custom view canvas? For now I was able to have a second circle drawn at the same position and having its size changed using ObjectAnimator.
All circles are bouncing slowly on the canvas. I want to have that animatioon be applied to "BOSS" circle. Right now, I have another circle drawn behind it that is haviing its size changed from 0 to BOOS circle's size + some values.
Any help is appreciated.
I know the x and y coordinates in an bitmap and want to draw a rectangle there. I think this picture illustrates what I want.
Lets say I want to draw a green rectangle over the red one. I know the coordinates of the top left corner and the coordinates of the bottom left corner. Usually it should not be a problem. But I display the bitmap in an Imageview. I use this code to map the coordinates form the bitmap to the coordinates in the canvas of the imageview. For image_view_width and image_view_height I use the getHeight and getWidth form inside of the Imageview.
This solution works on my real device but on the emulator it shows the rectangle on the wrong position. Can someone help me and tell me what is wrong?
I wanted to draw a rectangle with rounded corners in OpenGL|ES.
The user will input 3 things:
Coordinates of top left corner (X1,Y1).
Coordinates of bottom right corner (X2,Y2).
radius for the roundness of the corner (r).
The approach I am currently taking is that I will draw 3 rectangles based on the input given by the user and then will draw four arcs on each of the four corners of the rectangle.
is it the right way of doing it or is there some better approach for this ?
Stage 1. I have a background
Stage 2. I apply an overlay to background with a canvas to draw. First I fill the whole area with canvas.drawColor(Color.argb(128,0,0,0))
Then I need to draw a red transparent circle with color.argb(128,255,0,0) at a specified place, but I want circle red transparency replaced black filling transparency, not added. So, I wanna get this
but NOT this
How can I get it?
You can try to use Canvas.clipPath before filling area with black color to exclude area, which will be used later by circle.