I tried to create a power button in xaml.
I used http://en.wikipedia.org/wiki/File:IEC5009_Standby_Symbol.svg as a base:
With inkscape I was able to convert the svg to xaml:
SVG
XAML
First try: https://github.com/chefkoch/MediaPortal-2/commit/a37d0f906d5003fb6e0e61aa86807f4549e6210e
Result:
In Blend the path (half power button) was rendered fine:
![20130528_031830.png 20130528_031830.png](https://forum.team-mediaportal.com/download/2013/05/thumb/173980_20130528_031830.png)
Second try: https://github.com/chefkoch/MediaPortal-2/commit/1c18fc00e94f5843d9f2d243b05506fa94fc883f
MP2 was loaded nicely, but the (half) power button looks like this:
![20130528_032057.png 20130528_032057.png](https://forum.team-mediaportal.com/download/2013/05/thumb/173981_20130528_032057.png)
Even enabling anti-aliasing did not changed anything.
EDIT: Now I realized I may should have kept the commas within the data attribute. Too late for now.
If anybody else would like to continue this experiment feel free![Smile :) :)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
I used http://en.wikipedia.org/wiki/File:IEC5009_Standby_Symbol.svg as a base:
![177px-IEC5009_Standby_Symbol.svg.png](/proxy.php?image=http%3A%2F%2Fupload.wikimedia.org%2Fwikipedia%2Fcommons%2Fthumb%2Fb%2Fb2%2FIEC5009_Standby_Symbol.svg%2F177px-IEC5009_Standby_Symbol.svg.png&hash=fe0c54c1d18a79ba4888034713968bc2)
With inkscape I was able to convert the svg to xaml:
SVG
XML:
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 13.0.0, SVG Export Plug-In -->
<!DOCTYPE svg [
<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
]>
<svg version="1.2" baseProfile="tiny"
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
x="0px" y="0px" width="177px" height="202px" viewBox="-0.8 -0.5 177 202" xml:space="preserve">
<defs>
</defs>
<path fill="none" stroke="#000000" stroke-width="30" stroke-linecap="round" d="M33.7,64.3C22.1,77.2,15,94.3,15,113
c0,40.1,32.5,72.7,72.7,72.7c40.1,0,72.7-32.5,72.7-72.7c0-18.7-7.1-35.8-18.7-48.7"/>
<line fill="none" stroke="#000000" stroke-width="30" stroke-linecap="round" x1="87.8" y1="15" x2="87.8" y2="113"/>
</svg>
XAML
XML:
<?xml version="1.0" encoding="UTF-8"?>
<Viewbox xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" Stretch="Uniform">
<Canvas Name="svg2997" Width="177" Height="202" Canvas.Left="0" Canvas.Top="0">
<Canvas.RenderTransform>
<TranslateTransform X="0,8" Y="0,5"/>
</Canvas.RenderTransform>
<Canvas.Resources/>
<!--Unknown tag: metadata-->
<!--Unknown tag: sodipodi:namedview-->
<Path xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Name="path3001" StrokeThickness="30" Stroke="#FF000000" StrokeStartLineCap="Round" StrokeEndLineCap="Round">
<Path.Data>
<PathGeometry Figures="M33.7 64.3C22.1 77.2 15 94.3 15 113 c0 40.1 32.5 72.7 72.7 72.7c40.1 0 72.7-32.5 72.7-72.7c0-18.7-7.1-35.8-18.7-48.7" FillRule="NonZero"/>
</Path.Data>
</Path>
<Line xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" X1="87.8" Y1="15" X2="87.8" Y2="113" Name="line3003" StrokeThickness="30" Stroke="#FF000000" StrokeStartLineCap="Round" StrokeEndLineCap="Round"/>
</Canvas>
</Viewbox>
First try: https://github.com/chefkoch/MediaPortal-2/commit/a37d0f906d5003fb6e0e61aa86807f4549e6210e
Result:
Code:
[2013-05-28 03:15:11,651] [14185 ] [AMQ 'ScreenManager'] [ERROR] - Unhandled exception in message handler of async message queue 'ScreenManager' when handling a message of type 'ShowScreen'
MediaPortal.UI.SkinEngine.Xaml.Exceptions.ConvertException: Could not convert object '72.7-32.5' to type 'Single'
bei MediaPortal.UI.SkinEngine.Xaml.TypeConverter.Convert(Object value, Type targetType)
bei MediaPortal.UI.SkinEngine.Controls.Visuals.Shapes.Path.ParsePath()
bei MediaPortal.UI.SkinEngine.Controls.Visuals.Shapes.Path.CalculateTransformedPath(RectangleF baseRect)
bei MediaPortal.UI.SkinEngine.Controls.Visuals.Shapes.Path.CalculateInnerDesiredSize(SizeF totalSize)
bei MediaPortal.UI.SkinEngine.Controls.Visuals.FrameworkElement.Measure(SizeF& totalSize)
bei MediaPortal.UI.SkinEngine.Controls.Panels.Grid.CalculateInnerDesiredSize(SizeF totalSize)
bei MediaPortal.UI.SkinEngine.Controls.Visuals.FrameworkElement.Measure(SizeF& totalSize)
bei MediaPortal.UI.SkinEngine.Controls.Visuals.Control.CalculateInnerDesiredSize(SizeF totalSize)
bei MediaPortal.UI.SkinEngine.Controls.Visuals.FrameworkElement.Measure(SizeF& totalSize)
bei MediaPortal.UI.SkinEngine.Controls.Panels.Grid.CalculateInnerDesiredSize(SizeF totalSize)
bei MediaPortal.UI.SkinEngine.Controls.Visuals.FrameworkElement.Measure(SizeF& totalSize)
bei MediaPortal.UI.SkinEngine.Controls.Visuals.Control.CalculateInnerDesiredSize(SizeF totalSize)
bei MediaPortal.UI.SkinEngine.Controls.Visuals.FrameworkElement.Measure(SizeF& totalSize)
bei MediaPortal.UI.SkinEngine.Controls.Panels.DockPanel.CalculateDesiredSize(IEnumerator`1 currentVisibleChildEnumerator, SizeF currentAvailableSize)
bei MediaPortal.UI.SkinEngine.Controls.Panels.DockPanel.CalculateInnerDesiredSize(SizeF totalSize)
bei MediaPortal.UI.SkinEngine.Controls.Visuals.FrameworkElement.Measure(SizeF& totalSize)
bei MediaPortal.UI.SkinEngine.Controls.Panels.Grid.CalculateInnerDesiredSize(SizeF totalSize)
bei MediaPortal.UI.SkinEngine.Controls.Visuals.FrameworkElement.Measure(SizeF& totalSize)
bei MediaPortal.UI.SkinEngine.Controls.Panels.DockPanel.CalculateDesiredSize(IEnumerator`1 currentVisibleChildEnumerator, SizeF currentAvailableSize)
bei MediaPortal.UI.SkinEngine.Controls.Panels.DockPanel.CalculateInnerDesiredSize(SizeF totalSize)
bei MediaPortal.UI.SkinEngine.Controls.Visuals.FrameworkElement.Measure(SizeF& totalSize)
bei MediaPortal.UI.SkinEngine.Controls.Visuals.FrameworkElement.UpdateLayoutRoot(SizeF skinSize)
bei MediaPortal.UI.SkinEngine.ScreenManagement.Screen.Prepare()
bei MediaPortal.UI.SkinEngine.ScreenManagement.ScreenManager.DoExchangeScreen_NoLock(Screen screen)
bei MediaPortal.UI.SkinEngine.ScreenManagement.ScreenManager.DoShowScreen_NoLock(Screen screen, Boolean closeDialogs)
bei MediaPortal.UI.SkinEngine.ScreenManagement.ScreenManager.OnMessageReceived(AsynchronousMessageQueue queue, SystemMessage message)
bei MediaPortal.Common.Messaging.AsynchronousMessageQueue.DoWork()
![20130528_031830.png 20130528_031830.png](https://forum.team-mediaportal.com/download/2013/05/thumb/173980_20130528_031830.png)
Second try: https://github.com/chefkoch/MediaPortal-2/commit/1c18fc00e94f5843d9f2d243b05506fa94fc883f
MP2 was loaded nicely, but the (half) power button looks like this:
![20130528_032057.png 20130528_032057.png](https://forum.team-mediaportal.com/download/2013/05/thumb/173981_20130528_032057.png)
Even enabling anti-aliasing did not changed anything.
EDIT: Now I realized I may should have kept the commas within the data attribute. Too late for now.
If anybody else would like to continue this experiment feel free
Last edited: