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">
...
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...
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).
...
How I can convert a shape file (GIS) to text?
or, How I can extract the information in a shape file?
...
How to draw the spring like shape using c# drawing class
...
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...
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.
...
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...
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?
...
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
...
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
...
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...
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...
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...
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 ?
...
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...
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=...
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?
...
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...