shape

Android multiple stroke box in drawable xml

I'm trying to achieve what amounts to effectively 2 strokes on a rectangle in a <shape> element in an android drawable xml. A dark green outer line and a light green inner line, with a gradient fill in the center of it all. My code currently looks like this: <layer-list xmlns:android="http://schemas.android.com/apk/res/android"&gt; ...

How to define a circle shape in an android xml drawable file?

I have some problems finding the documentation of the definitions of shapes in XML for Android. I would like to define a simple circle filled with a solid color in an XML File to include it into my layout files. Sadly the Documentation on android.com does not cover the XML attributes of the Shape classes. I think I should use an ArcSha...

[javascript] Click on given element in canvas.

Is there any trick to determine if user clicks on given element rendered in canvas? For example I'm displaying rhombus from .png file with transparent background and i want to know if user click inside or outside that figure (like mouse-element collision). ...

shape file (GIS) to text

How I can convert a shape file (GIS) to text? or, How I can extract the information in a shape file? ...

spring like drawing in c#

How to draw the spring like shape using c# drawing class ...

Shape glass effect

Hi, I've created a custom toolbar using a gradient inside a shape. It looks very nice, but since we only have the option for 3 colors (startColor, centerColor, endColor) it looks very round. I would like to do a glass effect, which requires a sharp change in color in the middle. Basically I need 4 colors (startColor, justabovecenterC...

WPF custom shape control

Hi I was wondering if it is possible to make a custom shape custom control. I need to make control which contains textbox, however the control must have a shape of triangle or sth more sophisticated than regular rectangle/square. ...

Oval Gradient in Android

I know how to setup and display an oval shape. I know how to apply a gradient to this shape. What I cant figure out is how I can get an oval gradient to match the shape. <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval" > <gradient android:st...

Canvas.DrawCircle VS ShapeDrawable.setBounds()

Hello What is a more efficient methods for drawing circles on a canvas. I can do it two ways: 1) Use canvas.drawcircle(...) 2) ShapeDrawable.SetBounds() followed by ShapeDrawable.draw(canvas) what renders faster? What's better practice? Or does it not matter? ...

Polygon shape usercontrol

Hi Is there any way to set style for my UserControl to look like polygon, for example triangle or sth more sophisticated? I was reading that in WPF there is almost no limits when it comes to modifing graphical interface ...

Is there a way to programmatically convert other Xaml elements to path elements?

In Blend, it is possible to convert certain Xaml elements to Path, using Object->Path->Convert to Path option. Is there some API to do the same programmatically, in a WPF application? Thanks ...

Smooth a convex polygonal shape so that it becomes as large as possible while retaining diameter

Given a convex polygon, I am trying to grow its shape (as in "maximal area") while preserving its diameter. The diameter is defined as the length of the longest segment that can be placed within the polygon. Since the polygon is convex, I assume that this diameter can always be found by scanning all vertex pairs. For example, given an e...

How would one make this shape in an HTML5 canvas?

Hello, I'm wonder how you would go about and create a shape similar to this one below in HTML5 Canvas. It's more or less a cropped circle I guess, though my need would render it a synch different. context.fillStyle = "#000"; context.beginPath(); context.arc(200,200,100,0,Math.PI*2,true); context.closePath(); context.fill(); Now to c...

Create table / grid in a Wireframe Visio 2010 diagram

I'm loving the added Wireframe template and corresponding shapes in Visio 2010. One thing I can't seem to find though (not in Visio, Office help or using Google) is a good way to draw tabular controls. The only built-in shape that comes close is a List Box of which I can link several together. However this has several disadvantages as t...

How to change Shape border stroke runtime in Actionsctipt 3

I've got a complicated shape in a MovieClip. Runtime i want to change the stroke width of this Shape depending on a size ratio. How can I change this property without redrawing the entire Shape with the drawing API (almost impossible, is a map with very detailed borders) ? Is it possible ? ...

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 edges. I'm looking to add a header that has the two top edges rounded and a footer with t...

Is there an equivalent to setShadowLayer when defining shapes in XML in Android?

If I draw a round rect shape by code I can use setShadowLayer to get a shadow drawn for the shape. Is there an equivalent when defining shapes in XML? The following example draws a round rect background to a shape. What would I need to add to get a shadow added to the shape? Is it even possible using XML? shape_test.xml <?xml version=...

Performance wise, what is typically better, using an image or a xml created shape as a drawable?

For example, if each row in a list had a background that was a gradient, would it be better to use a image of a gradient or to define that gradient in a shape drawable in xml? Is there is significant performance difference between the two methods? ...

How to change the color of TextView at runtime with shape attribute on Android?

I'm using shape attribute like this: <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" android:padding="10dp"> <solid android:color="#FFFFFF" /> <corners android:bottomRightRadius="15dp" android:bottomLeftRadius="15dp" android:to...