Hi,
ich habe hier ein wunderschönes icon in XAML. Diese ist auf 76,76 ausgelegt.
<Canvas Margin="4" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:Name="appbar_tv_remote" Width="76" Height="76" Clip="F1 M 0,0L 76,0L 76,76L 0,76L 0,0">
<Path Width="29.7682" Height="47.5" Canvas.Left="23.1159" Canvas.Top="14.25" Stretch="Fill" Fill="#FF000000" Data="F1 M 38,26.9167C 39.7489,26.9167 41.1667,28.3344 41.1667,30.0833L 47.5,30.0833C 49.2489,30.0833 50.6667,31.5011 50.6667,33.25L 50.6666,58.5834C 50.6666,60.3322 49.2489,61.75 47.5,61.75L 28.5,61.75C 26.7511,61.75 25.3333,60.3322 25.3333,58.5834L 25.3333,33.25C 25.3333,31.5011 26.7511,30.0833 28.5,30.0833L 34.8333,30.0833C 34.8333,28.3344 36.2511,26.9167 38,26.9167 Z M 38,17.4167C 32.5252,17.4167 27.8616,20.8901 26.0927,25.7534L 23.1159,24.6709C 25.327,18.5917 31.1565,14.25 38,14.25C 44.8435,14.25 50.6729,18.5917 52.8841,24.6709L 49.9073,25.7534C 48.1384,20.8901 43.4748,17.4167 38,17.4167 Z M 38,23.75C 35.2626,23.75 32.9308,25.4867 32.0463,27.9184L 29.0695,26.8359C 30.3962,23.1884 33.8939,20.5834 38,20.5834C 42.1061,20.5834 45.6038,23.1884 46.9304,26.8359L 43.9536,27.9184C 43.0692,25.4867 40.7374,23.75 38,23.75 Z M 30.875,39.5834C 29.5633,39.5834 28.5,40.6467 28.5,41.9584C 28.5,43.27 29.5633,44.3334 30.875,44.3334C 32.1867,44.3334 33.25,43.27 33.25,41.9584C 33.25,40.6467 32.1867,39.5834 30.875,39.5834 Z M 37.9999,39.5834C 36.6882,39.5834 35.6249,40.6468 35.6249,41.9584C 35.6249,43.2701 36.6882,44.3334 37.9999,44.3334C 39.3116,44.3334 40.3749,43.2701 40.3749,41.9584C 40.3749,40.6468 39.3116,39.5834 37.9999,39.5834 Z M 45.1249,39.5834C 43.8132,39.5834 42.7499,40.6467 42.7499,41.9584C 42.7499,43.2701 43.8132,44.3334 45.1249,44.3334C 46.4366,44.3334 47.4999,43.2701 47.4999,41.9584C 47.4999,40.6467 46.4366,39.5834 45.1249,39.5834 Z M 30.875,45.9167C 29.5633,45.9167 28.5,46.98 28.5,48.2917C 28.5,49.6034 29.5633,50.6667 30.875,50.6667C 32.1866,50.6667 33.25,49.6034 33.25,48.2917C 33.25,46.98 32.1866,45.9167 30.875,45.9167 Z M 37.9999,45.9167C 36.6883,45.9167 35.6249,46.98 35.6249,48.2917C 35.6249,49.6034 36.6883,50.6667 37.9999,50.6667C 39.3116,50.6667 40.3749,49.6034 40.3749,48.2917C 40.3749,46.98 39.3116,45.9167 37.9999,45.9167 Z M 45.125,45.9167C 43.8133,45.9167 42.75,46.98 42.75,48.2917C 42.75,49.6034 43.8133,50.6667 45.125,50.6667C 46.4366,50.6667 47.5,49.6034 47.5,48.2917C 47.5,46.98 46.4366,45.9167 45.125,45.9167 Z M 30.875,52.2501C 29.5633,52.2501 28.5,53.3134 28.5,54.6251C 28.5,55.9367 29.5633,57.0001 30.875,57.0001C 32.1866,57.0001 33.25,55.9367 33.25,54.6251C 33.25,53.3134 32.1866,52.2501 30.875,52.2501 Z M 38,52.2501C 36.6883,52.2501 35.625,53.3134 35.625,54.6251C 35.625,55.9367 36.6883,57.0001 38,57.0001C 39.3116,57.0001 40.375,55.9367 40.375,54.6251C 40.375,53.3134 39.3116,52.2501 38,52.2501 Z M 45.125,52.25C 43.8133,52.25 42.75,53.3133 42.75,54.625C 42.75,55.9367 43.8133,57 45.125,57C 46.4367,57 47.5,55.9367 47.5,54.625C 47.5,53.3133 46.4367,52.25 45.125,52.25 Z M 45.9166,34.8334L 42.75,34.8334C 41.8755,34.8334 41.1666,35.5422 41.1666,36.4167C 41.1666,37.2911 41.8755,38 42.75,38L 45.9166,38C 46.7911,38 47.5,37.2911 47.5,36.4167C 47.5,35.5422 46.7911,34.8334 45.9166,34.8334 Z M 38,34.8334L 30.0833,34.8334C 29.2089,34.8334 28.5,35.5422 28.5,36.4167C 28.5,37.2911 29.2089,38 30.0833,38L 38,38C 38.8744,38 39.5833,37.2911 39.5833,36.4167C 39.5833,35.5422 38.8744,34.8334 38,34.8334 Z "/>
</Canvas>
Das ganze würde ich gern Scalieren z.b auf 150px. Mit einer ViewBox kann ich den Path wunderbar auf 150px bekomme nur dann fehlt mir der richtige Abstand und die Zentrierung.
Wie bekomme ich das ganze am schönsten hin?
Gruß
Mystic
Hallo MysticEmpires,
ich bin zwar ein wenig aus der Übung, aber ich würde es über den Weg von DrawingBrushes versuchen. Dort die Größe angeben. Schau dir das mal an.
mfG Gü
Stellt fachliche Fragen bitte im Forum, damit von den Antworten alle profitieren. Daher beantworte ich solche Fragen nicht per PM.
"Alle sagten, das geht nicht! Dann kam einer, der wusste das nicht - und hat's gemacht!"
Hallo allerseits,
ich verwende dafür keinen DrawingBrush, bei mir reicht eine Viewbox:
<Viewbox SnapsToDevicePixels="True" Stretch="Uniform" Width="76" Height="76" HorizontalAlignment="Left" VerticalAlignment="Center">
<!-- Icon -->
</Viewbox>
Wahrscheinlich fehlt bei dir die Angabe für die Stretch-Eigenschaft.
Christian
Weeks of programming can save you hours of planning