Questions tagged [shapes]

Questions related to drawing or defining shapes.

A shape is a geometric representation of some object, defined by the external boundaries which encompass the object.

For 2-D shapes like the circle, , and rectangle their shape is constructed of lines connected together.

3-D shapes are defined by a 2-D which envelopes the interior 3-D volume.

4362 questions
51
votes
4 answers

How to set a shape's background in xml?

I just created a red circle using android shapes:
Waza_Be
  • 39,407
  • 49
  • 186
  • 260
50
votes
1 answer

size of node with shape=circle

i'm trying to set the size of the nodes this way: controller[shape=circle,width=.5,label="Controller",style=filled,fillcolor="#8EC13A"]; But all three nodes are with different size. How can i set fixed size?
cupakob
  • 8,411
  • 24
  • 67
  • 76
49
votes
3 answers

More than six shapes in ggplot

I would like to plot lines with different shapes with more than six sets of data, using discrete colors. The problems are 1) a different legend is generated for line color and shape, but should be only one legend with the line color and shape, 2)…
user3969377
49
votes
2 answers

Android shape background

Is it possible to draw a shape in xml, and use a png as the background to that shape? I already have the shape (it's a square with rounded corners), and i would like to put a background to that square.
Dorin Rusu
  • 1,095
  • 2
  • 13
  • 26
48
votes
3 answers

How set alpha/opacity value to color on xml drawable?

I need to set a value of opacity to a color in xml drawable. But when i try to add the two values of opacity (#20C0C0C0) for example, don't work. The color appeares totaly transparent. Here is my code...
Ricardo Graça
  • 581
  • 2
  • 9
  • 17
45
votes
10 answers

How do I draw lines using XNA?

I've read a bunch of tutorials involving XNA (and it's various versions) and I still am a little confused on drawing primitives. Everything seems to be really convoluted. Can someone show me, using code, the simplest XNA implementation of drawing…
mmcdole
  • 91,488
  • 60
  • 186
  • 222
42
votes
6 answers

Half circle shape not work

I try to create half circle background, in development IDE preview it works, but when I launch in emulator it doesn't work. Here is my shape code :
fanjavaid
  • 1,676
  • 8
  • 34
  • 65
38
votes
2 answers

Android: How can I use the layer-list and shape elements to draw a horizontal rule when set as background?

I want to set the background of a Relative or LinearLayout to a custom drawable. I want the shape to draw two horizontal lines across the bottom, leaving the central part transparent (empty). The following draws the horizontal lines centered…
Emile
  • 11,451
  • 5
  • 50
  • 63
37
votes
4 answers

How to create a semi transparent shape?

I would like to know how to draw semi-transparent shapes in OpenCV, similar to those in the image below (from http://tellthattomycamera.wordpress.com/) I don't need those fancy circles, but I would like to be able to draw a rectangle, e.g, on a 3…
Bokonon
  • 391
  • 1
  • 5
  • 8
36
votes
7 answers

Creating a rectangle shape with only two rounded edges

I can create a shape that is a rectangle with all edges rounded. However, what I'm wanting is a rectangle shape with only 2 of the edges rounded. Is this possible? I'm essentially hacking together a ListView that looks like a bubble with rounded…
Andrew
  • 20,756
  • 32
  • 99
  • 177
35
votes
7 answers

How to create ring shape drawable in android?

with this code I get just a border:
S.M_Emamian
  • 17,005
  • 37
  • 135
  • 254
33
votes
3 answers

Android : stroke in a shape create a margin of the stroke width

I created a rectangle shape in order to use it as list item background. My problem is the stroke does not follow the view border but let a margin of +/- the stroke width. Here is the xml of my shape :
Anthony
  • 429
  • 1
  • 4
  • 10
31
votes
4 answers

How do I add padding to a bitmap and a color in a layer-list

I need to create a drawable with a layer-list such that the background layer is an image and the foreground is a transparent color. I am able to do that. Where I am not succeeding is adding some padding/margin so that at them bottom a piece of the…
learner
  • 11,490
  • 26
  • 97
  • 169
30
votes
4 answers

Is there an easy and fast way of checking if a polygon is self-intersecting?

I have a System.Windows.Shapes.Polygon object, whose layout is determined completely by a series of points. I need to determine if this polygon is self-intersecting, i.e., if any of the sides of the polygon intersect any of the other sides at a…
GWLlosa
  • 23,995
  • 17
  • 79
  • 116
29
votes
4 answers

How to change the shape of Floating Action Button (FAB) on android?

In our android app we need to create a floating action button which isn't the default circle but a square with with three rounded corners. The fab looks like in the image below: I managed to create such a form but don't know how to apply it to my…