Note that there are some explanatory texts on larger screens.

plurals
  1. POEvenly Spaced Dashes with StrokeDashArray
    primarykey
    data
    text
    <p>I'm trying to create a poker chip like the one here: <a href="http://www.casinowholesalers.com/shop/product_info.php?cPath=57&amp;products_id=379" rel="noreferrer">http://www.casinowholesalers.com/shop/product_info.php?cPath=57&amp;products_id=379</a> using Expression Blend 4 for a WP7.1 Silverlight 4 app.</p> <p>I'm trying to create the six white "boxes" on the edge of the chip (ignoring for now the dice images and inner dashed line). The way I did it was two create two ellipses, one with no stroke, the other is the exact same size but with a stroke of 24, a color of White, and the StrokeDashArray to 1.8 (that's not "1 8", it's actually 1.8 with no second value). It looks pretty close to evenly sized and spaced (but not quite); I found it by trial and error. The XAML is below.</p> <pre><code>&lt;Grid x:Name="LayoutRoot" Background="Transparent"&gt; &lt;Grid.RowDefinitions&gt; &lt;RowDefinition Height="Auto"/&gt; &lt;RowDefinition Height="*"/&gt; &lt;/Grid.RowDefinitions&gt; &lt;Ellipse Fill="#FFC83838" Margin="112,253,128,275" Grid.Row="1" Stroke="#FFC83838" StrokeThickness="3"/&gt; &lt;Ellipse Fill="#FFC83838" Margin="112,253,128,275" Grid.Row="1" Stroke="White" StrokeThickness="30" StrokeDashArray="1.79" StrokeDashOffset="6" RenderTransformOrigin="0.5,0.5"/&gt; &lt;/Grid&gt; </code></pre> <p>I guess I have two questions:</p> <ol> <li>Is there a better way to create this shape besides using two ellipses?</li> <li>How can I mathematically determine what the StrokeDashArray value should be so the dashes are evenly spaced and sized instead of using trial and error?</li> </ol>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload