home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 2
Skins and Design
XAML & MPF: PowerButton
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="chefkoch" data-source="post: 997816" data-attributes="member: 10438"><p>I tried to create a power button in xaml.</p><p> </p><p>I used <a href="http://en.wikipedia.org/wiki/File:IEC5009_Standby_Symbol.svg" target="_blank">http://en.wikipedia.org/wiki/File:IEC5009_Standby_Symbol.svg</a> as a base:</p><p><img src="http://upload.wikimedia.org/wikipedia/commons/thumb/b/b2/IEC5009_Standby_Symbol.svg/177px-IEC5009_Standby_Symbol.svg.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p><p> </p><p>With <a href="http://inkscape.org/" target="_blank">inkscape</a> I was able to convert the svg to xaml:</p><p>SVG</p><p>[code=xml]<?xml version="1.0" encoding="utf-8"?></p><p><!-- Generator: Adobe Illustrator 13.0.0, SVG Export Plug-In --></p><p><!DOCTYPE svg [</p><p> <!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/"></p><p>]></p><p><svg version="1.2" baseProfile="tiny"</p><p> xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"</p><p> x="0px" y="0px" width="177px" height="202px" viewBox="-0.8 -0.5 177 202" xml:space="preserve"></p><p><defs></p><p></defs></p><p><path fill="none" stroke="#000000" stroke-width="30" stroke-linecap="round" d="M33.7,64.3C22.1,77.2,15,94.3,15,113</p><p> 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"/></p><p><line fill="none" stroke="#000000" stroke-width="30" stroke-linecap="round" x1="87.8" y1="15" x2="87.8" y2="113"/></p><p></svg></p><p>[/CODE]</p><p> </p><p>XAML</p><p>[CODE=XML]<?xml version="1.0" encoding="UTF-8"?></p><p><Viewbox xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" Stretch="Uniform"></p><p> <Canvas Name="svg2997" Width="177" Height="202" Canvas.Left="0" Canvas.Top="0"></p><p> <Canvas.RenderTransform></p><p> <TranslateTransform X="0,8" Y="0,5"/></p><p> </Canvas.RenderTransform></p><p> <Canvas.Resources/></p><p> <!--Unknown tag: metadata--></p><p> <!--Unknown tag: sodipodi:namedview--></p><p> <Path xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Name="path3001" StrokeThickness="30" Stroke="#FF000000" StrokeStartLineCap="Round" StrokeEndLineCap="Round"></p><p> <Path.Data></p><p> <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"/></p><p> </Path.Data></p><p> </Path></p><p> <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"/></p><p> </Canvas></p><p></Viewbox></p><p>[/CODE]</p><p> </p><p> </p><p>First try: <a href="https://github.com/chefkoch/MediaPortal-2/commit/a37d0f906d5003fb6e0e61aa86807f4549e6210e" target="_blank">https://github.com/chefkoch/MediaPortal-2/commit/a37d0f906d5003fb6e0e61aa86807f4549e6210e</a></p><p>Result:</p><p>[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'</p><p>MediaPortal.UI.SkinEngine.Xaml.Exceptions.ConvertException: Could not convert object '72.7-32.5' to type 'Single'</p><p> bei MediaPortal.UI.SkinEngine.Xaml.TypeConverter.Convert(Object value, Type targetType)</p><p> bei MediaPortal.UI.SkinEngine.Controls.Visuals.Shapes.Path.ParsePath()</p><p> bei MediaPortal.UI.SkinEngine.Controls.Visuals.Shapes.Path.CalculateTransformedPath(RectangleF baseRect)</p><p> bei MediaPortal.UI.SkinEngine.Controls.Visuals.Shapes.Path.CalculateInnerDesiredSize(SizeF totalSize)</p><p> bei MediaPortal.UI.SkinEngine.Controls.Visuals.FrameworkElement.Measure(SizeF& totalSize)</p><p> bei MediaPortal.UI.SkinEngine.Controls.Panels.Grid.CalculateInnerDesiredSize(SizeF totalSize)</p><p> bei MediaPortal.UI.SkinEngine.Controls.Visuals.FrameworkElement.Measure(SizeF& totalSize)</p><p> bei MediaPortal.UI.SkinEngine.Controls.Visuals.Control.CalculateInnerDesiredSize(SizeF totalSize)</p><p> bei MediaPortal.UI.SkinEngine.Controls.Visuals.FrameworkElement.Measure(SizeF& totalSize)</p><p> bei MediaPortal.UI.SkinEngine.Controls.Panels.Grid.CalculateInnerDesiredSize(SizeF totalSize)</p><p> bei MediaPortal.UI.SkinEngine.Controls.Visuals.FrameworkElement.Measure(SizeF& totalSize)</p><p> bei MediaPortal.UI.SkinEngine.Controls.Visuals.Control.CalculateInnerDesiredSize(SizeF totalSize)</p><p> bei MediaPortal.UI.SkinEngine.Controls.Visuals.FrameworkElement.Measure(SizeF& totalSize)</p><p> bei MediaPortal.UI.SkinEngine.Controls.Panels.DockPanel.CalculateDesiredSize(IEnumerator`1 currentVisibleChildEnumerator, SizeF currentAvailableSize)</p><p> bei MediaPortal.UI.SkinEngine.Controls.Panels.DockPanel.CalculateInnerDesiredSize(SizeF totalSize)</p><p> bei MediaPortal.UI.SkinEngine.Controls.Visuals.FrameworkElement.Measure(SizeF& totalSize)</p><p> bei MediaPortal.UI.SkinEngine.Controls.Panels.Grid.CalculateInnerDesiredSize(SizeF totalSize)</p><p> bei MediaPortal.UI.SkinEngine.Controls.Visuals.FrameworkElement.Measure(SizeF& totalSize)</p><p> bei MediaPortal.UI.SkinEngine.Controls.Panels.DockPanel.CalculateDesiredSize(IEnumerator`1 currentVisibleChildEnumerator, SizeF currentAvailableSize)</p><p> bei MediaPortal.UI.SkinEngine.Controls.Panels.DockPanel.CalculateInnerDesiredSize(SizeF totalSize)</p><p> bei MediaPortal.UI.SkinEngine.Controls.Visuals.FrameworkElement.Measure(SizeF& totalSize)</p><p> bei MediaPortal.UI.SkinEngine.Controls.Visuals.FrameworkElement.UpdateLayoutRoot(SizeF skinSize)</p><p> bei MediaPortal.UI.SkinEngine.ScreenManagement.Screen.Prepare()</p><p> bei MediaPortal.UI.SkinEngine.ScreenManagement.ScreenManager.DoExchangeScreen_NoLock(Screen screen)</p><p> bei MediaPortal.UI.SkinEngine.ScreenManagement.ScreenManager.DoShowScreen_NoLock(Screen screen, Boolean closeDialogs)</p><p> bei MediaPortal.UI.SkinEngine.ScreenManagement.ScreenManager.OnMessageReceived(AsynchronousMessageQueue queue, SystemMessage message)</p><p> bei MediaPortal.Common.Messaging.AsynchronousMessageQueue.DoWork()</p><p>[/CODE]</p><p>In Blend the path (half power button) was rendered fine:</p><p>[ATTACH]129358[/ATTACH]</p><p> </p><p>Second try: <a href="https://github.com/chefkoch/MediaPortal-2/commit/1c18fc00e94f5843d9f2d243b05506fa94fc883f" target="_blank">https://github.com/chefkoch/MediaPortal-2/commit/1c18fc00e94f5843d9f2d243b05506fa94fc883f</a></p><p>MP2 was loaded nicely, but the (half) power button looks like this:</p><p>[ATTACH]129359[/ATTACH]</p><p> </p><p> </p><p>Even enabling anti-aliasing did not changed anything.</p><p> </p><p> </p><p> </p><p>EDIT: Now I realized I may should have kept the commas within the data attribute. Too late for now.</p><p>If anybody else would like to continue this experiment feel free <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite1" alt=":)" title="Smile :)" loading="lazy" data-shortname=":)" /></p></blockquote><p></p>
[QUOTE="chefkoch, post: 997816, member: 10438"] I tried to create a power button in xaml. I used [url]http://en.wikipedia.org/wiki/File:IEC5009_Standby_Symbol.svg[/url] as a base: [IMG]http://upload.wikimedia.org/wikipedia/commons/thumb/b/b2/IEC5009_Standby_Symbol.svg/177px-IEC5009_Standby_Symbol.svg.png[/IMG] With [URL='http://inkscape.org/']inkscape[/URL] I was able to convert the svg to xaml: SVG [code=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> [/CODE] XAML [CODE=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> [/CODE] First try: [url]https://github.com/chefkoch/MediaPortal-2/commit/a37d0f906d5003fb6e0e61aa86807f4549e6210e[/url] 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() [/CODE] In Blend the path (half power button) was rendered fine: [ATTACH]129358[/ATTACH] Second try: [url]https://github.com/chefkoch/MediaPortal-2/commit/1c18fc00e94f5843d9f2d243b05506fa94fc883f[/url] MP2 was loaded nicely, but the (half) power button looks like this: [ATTACH]129359[/ATTACH] 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 :) [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 2
Skins and Design
XAML & MPF: PowerButton
Contact us
RSS
Top
Bottom