Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Windows Presentation Foundation Discussion :

Utilisation SVG avec sharpvectors dans WPF


Sujet :

Windows Presentation Foundation

  1. #1
    Futur Membre du Club
    Utilisation SVG avec sharpvectors dans WPF
    Bonjour,

    Je viens afin d'avoir quelques conseils.

    je construit actuellement une application WPF et je souhaiterais n'avoir qu'un seul fichier SVG que de découperais en plusieurs images sans avoir à le convertir en PNG,
    la cerise sur le gâteau serait de pouvoir appliquer des filtres pour faire des effets OnHover sur les boutons toujours avec la même image mais bon dans un deuxième temps si c'est possible .
    Tout les éléments seraient lister dans un ResourceDictionary afin de les utiliser facilement.

    voici comment j'effectuais la tâche avec un png j'aurais au moins souhaité avoir la même chose avec directement le fichier Svg.
    J'essaye de faire cela avec la librairie Sharpvectors ( https://github.com/ElinamLLC/SharpVectors ) mais le type SvgIImage ne passe pas dans <ImageBrush ImageSource="ImageSvg"> car pas le bon type et je n'ai pas trouvé d'exemple de découpage.

    Code XAML :Sélectionner tout -Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    <Style TargetType="Rectangle" x:Key="Save">
            <Setter Property="Height" Value="25"></Setter>
            <Setter Property="Width" Value="25"></Setter>
            <Setter Property="Fill">
                <Setter.Value>
                    <ImageBrush ImageSource="{StaticResource Sprite16x16Normal}" ViewboxUnits="Absolute" Viewbox="48,0,16,16"></ImageBrush>
                </Setter.Value>
            </Setter>
            <Style.Triggers>
                <Trigger Property="IsMouseOver" Value="true">
                    <Setter Property="Fill">
                        <Setter.Value>
                            <ImageBrush ImageSource="{StaticResource Sprite16x16Hover}" ViewboxUnits="Absolute" Viewbox="48,0,16,16"></ImageBrush>
                        </Setter.Value>
                    </Setter>
                </Trigger>
            </Style.Triggers>
        </Style>


    merci d'avance pour votre aide.

  2. #2
    Expert confirmé
    bonjour

    Il y a un loupé dans cette version 1.5 disponible en nuget package.
    Voir la version 1.0 plus ancienne mais fonctionnelle sur le site Code Projet.

    Tu peux aussi passer par cet autre outil SvgToXAML en fait un converter qui affiche
    sur un éditeur texte le résultat XAML de la conversion du fichier .svg que tu peux "paster" directement dans l’éditeur VS.
    https://github.com/BerndK/SvgToXaml

    bon code.

  3. #3
    Futur Membre du Club
    Merci pour ta réponse.
    Actuellement j'arrive avec Sharpvectors a voir du svg dans le Viewer.
    Mais ce qui m’intéresse le plus c'est de pouvoir découper l'image exemple fichier avec des images en 16*16.
    Mais je vais regarder de plus près SvgToXaml.

  4. #4
    Expert confirmé
    Citation Envoyé par mergin Voir le message
    Merci pour ta réponse.
    Actuellement j'arrive avec Sharpvectors a voir du svg dans le Viewer.
    Mais ce qui m’intéresse le plus c'est de pouvoir découper l'image exemple fichier avec des images en 16*16.
    Mais je vais regarder de plus près SvgToXaml.
    Ah bah tu as en WPF le CroppedBitmap(rognage).
    code .cs
    Code :Sélectionner tout -Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
     
     
    private void CutImage(string img)
    {
        int count = 0;
     
        BitmapImage src = new BitmapImage();
        src.BeginInit();
        src.UriSource = new Uri(img, UriKind.Relative);
        src.CacheOption = BitmapCacheOption.OnLoad;
        src.EndInit();
     
        for (int i = 0; i < 3; i++)
            for (int j = 0; j < 3; j++)
                objImg[count++] = new CroppedBitmap(src, new Int32Rect(j * 120, i * 120, 120, 120));
    }

    bon code...

  5. #5
    Futur Membre du Club
    je viens de tester la méthode avec la classe CroppedBitmap mais je n'arrive pas vraiment à un résultat concluant je dois mal m'y prendre
    mais peut être que ce n'est pas une bonne idée de convertir au format png pour le rogner ça serait peut être mieux de convertir en xaml et découper le fichier.
    voici mon code:

    Code :Sélectionner tout -Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
     
      Stream StreamFile = new MemoryStream();
                WpfDrawingSettings settings = new WpfDrawingSettings();
                settings.IncludeRuntime = false;
                settings.TextAsGeometry = true;
     
                //Converter de SharpVector
                StreamSvgConverter stremConvert = new StreamSvgConverter(settings);
                stremConvert.EncoderType = ImageEncoderType.PngBitmap;
                stremConvert.Convert("SpriteImgNormal_16px_16px.svg", StreamFile);
     
                BitmapImage imgc = new BitmapImage();
                imgc.BeginInit();
                imgc.StreamSource = StreamFile;
                imgc.CacheOption = BitmapCacheOption.OnLoad;
                imgc.EndInit();
                //mm unit
                double widthPixel = 16 / imgc.DpiX * milimetresPerInch;
                double HeightPixel = 16 / imgc.DpiY * milimetresPerInch;
                CroppedBitmap testCrop = new CroppedBitmap(imgc, new Int32Rect(0, 0, (int)widthPixel, (int)HeightPixel));
                //je retournes l'objet dans une vue


    voici l'image que j'obtiens et ce que je voudrais

  6. #6
    Futur Membre du Club
    j'essaye finalement d'utiliser directement le svg convertie en xaml ça me semble être la meilleur méthode.
    Je penses ne pas être loin de réussir mais je ne vois pas pourquoi mes éléments ne s'affiche pas une idée ?

    je flag mes objets dans inskape (ex:Name Icone_Save, Icone_Loupe etc.)

    Code :Sélectionner tout -Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    XDocument rez = null;
    WpfDrawingSettings settings = new WpfDrawingSettings();
    settings.IncludeRuntime = false;
    settings.TextAsGeometry = true;
    FileSvgConverter Convert = new FileSvgConverter(settings);
    if (Convert.Convert(pathSvgFile))
    {
        if (File.Exists(Convert.XamlFile))
        {
            rez = XDocument.Load(Convert.XamlFile);
        }
    }
     
     
    IEnumerable<XElement> listIcone = docSvg.Root.DescendantsAndSelf().Where(d => d.Name.LocalName == "DrawingGroup" && d.HasAttributes && d.Attributes().FirstOrDefault(att => att.Name.LocalName == "Name" && att.Value.Contains("Icone_")) != null);
    //on selectionne seulement ceux avec un attribute Name
    List<DrawingGroup> listRez = new List<DrawingGroup>();
    foreach (XElement ico in listIcone)
    {
        XmlReader red = ico.CreateReader();
        FileSvgReader Convert = new FileSvgReader(settings);
        DrawingGroup Drawing = Convert.Read(red);
        listRez.Add(Drawing);
    }
     
     
    //j'obtient un liste de Drawing et je place dans un container StackPanel
     foreach (DrawingGroup it in test)
    {
        Viewbox ViewIcone = new Viewbox();
        DrawingBrush rez = new DrawingBrush(it);
        Rectangle rect = new Rectangle();
        rect.Fill = rez;
        //rect.Width = 16;
        //rect.Height = 16;
        ViewIcone.Child = rect;
        ContIcone.Children.Add(ViewIcone);
    }


    voici un exemple d'une icone récupéré dans le XElement
    Code XML :Sélectionner tout -Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    <?xml version="1.0"?>
        <DrawingGroup x:Name="Icone_Save" xmlns<img src="images/smilies/icon_mad.gif" border="0" alt="" title=":x" class="inlineimg" />="http://schemas.microsoft.com/winfx/2006/xaml" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
    	<ImageDrawing Rect="0.1710525,212.49164,3.9057806,3.785923">
    		<ImageDrawing.ImageSource>
    			<svg:EmbeddedBitmapSource Data="iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAABIAAAASABGyWs+AAAACXZwQWcAAAAQAAAAEABcxq3DAAACp0lEQVQ4y5WS21OSQRiHv7v+uK67cyZtLE95StNU8ICCoIAcFpBG6guQ05intCFOWgp+ojZKGTFpamolIOqYCET+WqDxksmLZ3Zndt/n/c27y8iMb2TKFzO+T/MeLrEyz8VzBOeuieXxcbHlAsd07x6f5JpEI1xtl7qCkbKvJ4hpxre/vnr1Z+cjfn8tztXuJhZcHjT1G9Ag0BJGbfMF9A5f9uDbIZC6wNXlr6IglcTSSgjtMhNoAiqwejmd3YOCIEkvXRQF6SQCwRBaB1jU8JWEUVk8nNbmwf4NBP7gBlokz1HNUxBGOZoTuG8mWN5As9iAqo6hnMDNaawuKjj4b8Eitw76CqhslxFGYXZxGosLB/uH+cPcIIuSucTi8joahU9R8URKmCGTi1ObndgMb+H0+BgnsXiexDWxAtECJ/E4nD4ODb16PGgdJIzc6OQkI1MYNExiiJ2GjK4ywwSkI+OQ6McgHnagX2eHUGtDH7HmaZeyqBcM437LAGGE+kmuR+NAp8oKnmIUluk5jM3Ow/TSiVlvAF7/e3gW1+B6F4R1ykufToWHnQR1PTqUP5YQplNt57rUNvCVFvAVZqx9iED9bAxSvQ1RGjmbzSKdTuEyeYHI1i4tVqGKp0Jttxb3msWE4SutXK44150nN2E1FIFYMwqB0oifR1FkMhmcn5/j7OwM4S9fUftPUENTlDX1E4ansCzlijvkZvo9jVjZ+AwRMaNLzuLw+w/aPY1EIoHT0xMq2MknqOxQopqvRukjEWFaJGwj/dcnbVIj2gZZrFKB45UXrH0GR9EoUqkU4nTyhQRUwC8IqnhK3G3oUzEl9aJbdKJl9QKdpq6bEPfbJRIKhYjf7yeRSITs7e2RcDhMtre3yEIgSGgRKanrJaWNQvWd8tbbfwEsaC3A9+md8QAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAwOS0wOS0xM1QxNTozNTozNyswMjowMCGGG3EAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMDktMDktMTNUMTU6MzU6MzcrMDI6MDBQ26PNAAAAAElFTkSuQmCC" xmlns:svg="http://sharpvectors.codeplex.com/runtime/" />
    		</ImageDrawing.ImageSource>
    	</ImageDrawing>
    	<GeometryDrawing x:Name="rect5070" Brush="#FF697C92">
    		<GeometryDrawing.Geometry>
    			<RectangleGeometry RadiusX="0.2085" RadiusY="0.2085" Rect="0.1711,212.4916,3.9058,3.7859" />
    		</GeometryDrawing.Geometry>
    	</GeometryDrawing>
    	<GeometryDrawing x:Name="rect5038" Brush="#FFF9F9F9">
    		<GeometryDrawing.Geometry>
    			<RectangleGeometry RadiusX="0" RadiusY="0" Rect="0.5576,214.5602,3.1261,1.6323" />
    		</GeometryDrawing.Geometry>
    	</GeometryDrawing>
    	<GeometryDrawing x:Name="rect5038_0" Brush="#FFF4D3C8">
    		<GeometryDrawing.Geometry>
    			<RectangleGeometry RadiusX="0.1123" RadiusY="0.1123" Rect="0.5576,214.1959,3.1261,0.4764" />
    		</GeometryDrawing.Geometry>
    	</GeometryDrawing>
    	<GeometryDrawing x:Name="rect5068_5" Brush="#FF8391A2">
    		<GeometryDrawing.Geometry>
    			<RectangleGeometry RadiusX="0.2433" RadiusY="0.2433" Rect="0.5683,212.5078,2.6742,1.2914" />
    		</GeometryDrawing.Geometry>
    	</GeometryDrawing>
    	<GeometryDrawing x:Name="rect5066">
    		<GeometryDrawing.Brush>
    			<SolidColorBrush Color="#FFFFFFFF" Opacity="0.87058824" />
    		</GeometryDrawing.Brush>
    		<GeometryDrawing.Geometry>
    			<RectangleGeometry RadiusX="0.2246" RadiusY="0.2246" Rect="0.5683,212.5078,1.9281,1.2914" />
    		</GeometryDrawing.Geometry>
    	</GeometryDrawing>
    	<GeometryDrawing x:Name="rect5068" Brush="#FF8391A2">
    		<GeometryDrawing.Geometry>
    			<RectangleGeometry RadiusX="0.2085" RadiusY="0.2085" Rect="0.7852,212.604,0.5061,1.1069" />
    		</GeometryDrawing.Geometry>
    	</GeometryDrawing>
    	<GeometryDrawing x:Name="rect5087" Brush="#FFEFF1F3">
    		<GeometryDrawing.Geometry>
    			<RectangleGeometry RadiusX="0" RadiusY="0" Rect="2.0329,212.5078,0.4634,1.2914" />
    		</GeometryDrawing.Geometry>
    	</GeometryDrawing>
    	<DrawingGroup x:Name="text5091" Transform="1.0157061,0,0,0.98453676,0,0">
    		<GeometryDrawing Brush="#FF000000">
    			<GeometryDrawing.Pen>
    				<Pen Thickness="0.01802526" StartLineCap="Flat" EndLineCap="Flat" LineJoin="Miter">
    					<Pen.Brush>
    						<SolidColorBrush Color="#FF000000" Opacity="0.41101697" />
    					</Pen.Brush>
    				</Pen>
    			</GeometryDrawing.Pen>
    			<GeometryDrawing.Geometry>
    				<GeometryGroup FillRule="Nonzero">
    					<PathGeometry FillRule="Nonzero" Figures="M1.31792807579041,217.720443725586C1.32833337783813,217.720443725586 1.33867979049683,217.721496582031 1.34896767139435,217.723602294922 1.35925555229187,217.725723266602 1.36846768856049,217.728576660156 1.3766040802002,217.732177734375L1.3766040802002,217.772079467773 1.37273144721985,217.772079467773C1.36623799800873,217.766525268555 1.35831665992737,217.761825561523 1.34896767139435,217.757995605469 1.33961868286133,217.754165649414 1.3300154209137,217.752243041992 1.32015776634216,217.752243041992 1.31632435321808,217.752243041992 1.31288194656372,217.752517700195 1.30983090400696,217.753067016602 1.30677974224091,217.753616333008 1.30357205867767,217.754669189453 1.30020797252655,217.756225585938 1.29746973514557,217.75749206543 1.29510319232941,217.759338378906 1.29310822486877,217.761810302734 1.29111325740814,217.764266967773 1.29011571407318,217.767028808594 1.29011571407318,217.770080566406 1.29011571407318,217.774536132813 1.29170000553131,217.778076171875 1.29486846923828,217.780700683594 1.29803693294525,217.783325195313 1.30415880680084,217.785690307617 1.31323409080505,217.787796020508 1.31910169124603,217.789123535156 1.32475411891937,217.790420532227 1.33019137382507,217.79167175293 1.33562874794006,217.792922973633 1.34143757820129,217.794647216797 1.34761810302734,217.796829223633 1.35974454879761,217.801223754883 1.36876106262207,217.807098388672 1.37466776371002,217.814498901367 1.38057446479797,217.821884155273 1.3835277557373,217.831649780273 1.3835277557373,217.843780517578 1.3835277557373,217.861145019531 1.37670183181763,217.875106811523 1.36304986476898,217.885665893555 1.34939801692963,217.896240234375 1.33095419406891,217.901519775391 1.30771851539612,217.901519775391 1.29434037208557,217.901519775391 1.28258562088013,217.90022277832 1.27245426177979,217.897644042969 1.26232290267944,217.895065307617 1.25291526317596,217.891845703125 1.24423122406006,217.88801574707L1.24423122406006,217.846481323242 1.24822115898132,217.846481323242C1.25698339939117,217.853912353516 1.26664543151855,217.859619140625 1.27720701694489,217.863616943359 1.28776872158051,217.867599487305 1.29801738262177,217.869598388672 1.30795323848724,217.869598388672 1.3104567527771,217.869598388672 1.31376218795776,217.869323730469 1.31786942481995,217.868774414063 1.32197678089142,217.868225097656 1.32528221607208,217.867370605469 1.32778573036194,217.866195678711 1.3308367729187,217.864868164063 1.33341860771179,217.863006591797 1.33553087711334,217.860610961914 1.33764326572418,217.85823059082 1.33869934082031,217.855087280273 1.33869934082031,217.851165771484 1.33869934082031,217.846786499023 1.33697819709778,217.843231201172 1.33353590965271,217.840484619141 1.33009362220764,217.837753295898 1.32598626613617,217.835754394531 1.32121396064758,217.834503173828 1.31526815891266,217.832946777344 1.30891156196594,217.831451416016 1.30214428901672,217.830047607422 1.2953770160675,217.828643798828 1.28905951976776,217.826919555664 1.28319203853607,217.824890136719 1.26965737342834,217.820114135742 1.25995635986328,217.813690185547 1.2540887594223,217.805633544922 1.24822115898132,217.797576904297 1.24528729915619,217.787490844727 1.24528729915619,217.775360107422 1.24528729915619,217.759002685547 1.25221109390259,217.74577331543 1.2660585641861,217.735641479492 1.27990615367889,217.725509643555 1.29719591140747,217.720443725586 1.31792807579041,217.720443725586z" />
    					<PathGeometry FillRule="Nonzero" Figures="M1.47736513614655,217.836502075195C1.47040224075317,217.837203979492 1.46476936340332,217.837814331055 1.46046650409698,217.838317871094 1.45616364479065,217.838821411133 1.45193886756897,217.839828491211 1.44779253005981,217.84130859375 1.44419372081757,217.842559814453 1.44139683246613,217.844467163086 1.43940186500549,217.84700012207 1.43740689754486,217.849548339844 1.4364093542099,217.852935791016 1.4364093542099,217.857162475586 1.4364093542099,217.863342285156 1.43807184696198,217.867584228516 1.44139683246613,217.869888305664 1.44472181797028,217.872192382813 1.44963097572327,217.873352050781 1.45612442493439,217.873352050781 1.45972323417664,217.873352050781 1.46340024471283,217.872528076172 1.46715557575226,217.870880126953 1.4709107875824,217.869247436523 1.47431397438049,217.866928100586 1.47736513614655,217.863967895508L1.47736513614655,217.836502075195z M1.45307338237762,217.762802124023C1.47576129436493,217.762802124023 1.49228835105896,217.766586303711 1.50265443325043,217.774124145508 1.51302051544189,217.781677246094 1.51820361614227,217.793197631836 1.51820361614227,217.808685302734L1.51820361614227,217.898345947266 1.47736513614655,217.898345947266 1.47736513614655,217.884384155273C1.47454869747162,217.886734008789 1.47202563285828,217.88883972168 1.46979594230652,217.890716552734 1.46756625175476,217.892593383789 1.46457386016846,217.894470214844 1.46081852912903,217.896347045898 1.45714151859283,217.898147583008 1.45356225967407,217.899520874023 1.45008087158203,217.900451660156 1.4465993642807,217.901397705078 1.44172930717468,217.901870727539 1.43547058105469,217.901870727539 1.42381358146667,217.901870727539 1.4141321182251,217.89794921875 1.40642595291138,217.89013671875 1.39871990680695,217.882308959961 1.39486682415009,217.872451782227 1.39486682415009,217.860565185547 1.39486682415009,217.850784301758 1.39682269096375,217.842880249023 1.40073442459106,217.836853027344 1.40464615821838,217.830825805664 1.41027903556824,217.826049804688 1.41763305664063,217.822540283203 1.42506539821625,217.818939208984 1.43394494056702,217.816436767578 1.44427192211151,217.815032958984 1.45459890365601,217.813613891602 1.46570825576782,217.812515258789 1.47759985923767,217.811737060547L1.47759985923767,217.81103515625C1.47759985923767,217.803756713867 1.47492027282715,217.798736572266 1.46956121921539,217.795959472656 1.46420216560364,217.793182373047 1.45616364479065,217.791793823242 1.44544541835785,217.791793823242 1.44059491157532,217.791793823242 1.43492293357849,217.792663574219 1.42842948436737,217.79443359375 1.42193603515625,217.796188354492 1.41559898853302,217.798446655273 1.40941846370697,217.801177978516L1.40589785575867,217.801177978516 1.40589785575867,217.769378662109C1.40996611118317,217.768203735352 1.41653776168823,217.766815185547 1.42561304569244,217.765213012695 1.43468821048737,217.763610839844 1.44384169578552,217.762802124023 1.45307338237762,217.762802124023z" />
    					<PathGeometry FillRule="Nonzero" Figures="M1.54690873622894,217.766555786133L1.58821666240692,217.766555786133 1.58821666240692,217.831924438477C1.58821666240692,217.838729858398 1.5883926153183,217.844284057617 1.58874475955963,217.848587036133 1.58909678459167,217.852890014648 1.58993780612946,217.856536865234 1.59126782417297,217.859497070313 1.59251952171326,217.862243652344 1.59445583820343,217.864318847656 1.5970766544342,217.86572265625 1.59969758987427,217.867126464844 1.60335505008698,217.867828369141 1.60804903507233,217.867828369141 1.61094379425049,217.867828369141 1.61436653137207,217.867126464844 1.61831736564636,217.86572265625 1.62226819992065,217.864318847656 1.62592566013336,217.862396240234 1.62928974628448,217.859970092773L1.62928974628448,217.766555786133 1.67036294937134,217.766555786133 1.67036294937134,217.898345947266 1.62928974628448,217.898345947266 1.62928974628448,217.8837890625C1.62217044830322,217.889739990234 1.61563777923584,217.894256591797 1.60969197750092,217.897354125977 1.60374617576599,217.900436401367 1.5966659784317,217.901977539063 1.58845138549805,217.901977539063 1.57538616657257,217.901977539063 1.56519615650177,217.897857666016 1.55788111686707,217.889602661133 1.55056619644165,217.88134765625 1.54690873622894,217.868927001953 1.54690873622894,217.852340698242L1.54690873622894,217.766555786133z" />
    					<PathGeometry FillRule="Nonzero" Figures="M1.68557453155518,217.766555786133L1.72876000404358,217.766555786133 1.75575089454651,217.853759765625 1.7823897600174,217.766555786133 1.82463645935059,217.766555786133 1.77734363079071,217.898345947266 1.73251521587372,217.898345947266 1.68557453155518,217.766555786133z" />
    					<PathGeometry FillRule="Nonzero" Figures="M1.89903569221497,217.788864135742C1.89105570316315,217.788864135742 1.88481652736664,217.791244506836 1.88031804561615,217.796020507813 1.87581956386566,217.80078125 1.87333559989929,217.807281494141 1.87286615371704,217.815490722656L1.92250597476959,217.815490722656C1.92227125167847,217.80680847168 1.92025673389435,217.800201416016 1.91646242141724,217.795669555664 1.91266798973083,217.791122436523 1.9068591594696,217.788864135742 1.89903569221497,217.788864135742z M1.90220415592194,217.762451171875C1.92238867282867,217.762451171875 1.9375661611557,217.767883300781 1.94773662090302,217.778762817383 1.95790719985962,217.789642333984 1.96299242973328,217.805206298828 1.96299242973328,217.825469970703L1.96299242973328,217.840255737305 1.87298357486725,217.840255737305C1.87337470054626,217.84635925293 1.87466561794281,217.851470947266 1.87685608863831,217.855575561523 1.87904667854309,217.859680175781 1.88194143772125,217.862945556641 1.88554012775421,217.865371704102 1.88906073570251,217.867797851563 1.89316809177399,217.869537353516 1.89786207675934,217.870590209961 1.90255618095398,217.871643066406 1.90768051147461,217.872177124023 1.91323518753052,217.872177124023 1.9180074930191,217.872177124023 1.92270159721375,217.871643066406 1.92731738090515,217.870590209961 1.93193328380585,217.869537353516 1.93615794181824,217.868148803711 1.93999147415161,217.866424560547 1.94335556030273,217.864944458008 1.94646537303925,217.863342285156 1.94932091236115,217.861618041992 1.95217645168304,217.859893798828 1.95450401306152,217.858367919922 1.956303358078,217.857040405273L1.96064531803131,217.857040405273 1.96064531803131,217.89094543457C1.95728123188019,217.892288208008 1.95421051979065,217.893508911133 1.9514331817627,217.894653320313 1.94865596294403,217.895782470703 1.94484198093414,217.896942138672 1.93999147415161,217.89811706543 1.9355320930481,217.899291992188 1.93093574047089,217.900207519531 1.92620253562927,217.900863647461 1.92146944999695,217.90153503418 1.9156996011734,217.901870727539 1.90889322757721,217.901870727539 1.88401460647583,217.901870727539 1.86494493484497,217.895919799805 1.85168421268463,217.884033203125 1.838423371315,217.872131347656 1.83179306983948,217.855194091797 1.83179306983948,217.833221435547 1.83179306983948,217.811706542969 1.83797359466553,217.794525146484 1.85033464431763,217.781692504883 1.86269569396973,217.76887512207 1.87998557090759,217.762451171875 1.90220415592194,217.762451171875z" />
    					<PathGeometry FillRule="Nonzero" Figures="M2.04697036743164,217.793792724609C2.03711271286011,217.793792724609 2.02970004081726,217.796966552734 2.02473211288452,217.803344726563 2.01976418495178,217.809722900391 2.0172803401947,217.818618774414 2.0172803401947,217.830047607422 2.0172803401947,217.835754394531 2.01765179634094,217.840591430664 2.01839518547058,217.844543457031 2.01913833618164,217.848495483398 2.02052688598633,217.851989746094 2.02256107330322,217.855041503906 2.02451705932617,217.858016967773 2.0270791053772,217.860260009766 2.03024768829346,217.861785888672 2.03341627120972,217.863311767578 2.03746485710144,217.864074707031 2.04239368438721,217.864074707031 2.04607057571411,217.864074707031 2.04968881607056,217.86344909668 2.05324864387512,217.862197875977 2.05680823326111,217.860946655273 2.06019186973572,217.859146118164 2.06339955329895,217.856796264648L2.06339955329895,217.797073364258C2.06136536598206,217.796127319336 2.05886197090149,217.795349121094 2.05588912963867,217.794723510742 2.05291604995728,217.794097900391 2.04994320869446,217.793792724609 2.04697036743164,217.793792724609z M2.03054094314575,217.762924194336C2.037269115448,217.762924194336 2.04329323768616,217.763778686523 2.04861330986023,217.765502929688 2.05393314361572,217.767227172852 2.05878376960754,217.76953125 2.06316494941711,217.772430419922L2.06469035148621,217.766555786133 2.10447263717651,217.766555786133 2.10447263717651,217.883209228516C2.10447263717651,217.895416259766 2.10271239280701,217.905776977539 2.09919190406799,217.914306640625 2.0956711769104,217.922836303711 2.09085988998413,217.929489135742 2.08475756645203,217.93424987793 2.07865524291992,217.939102172852 2.07134032249451,217.942611694336 2.06281280517578,217.944763183594 2.05428528785706,217.946914672852 2.04481887817383,217.947982788086 2.0344135761261,217.947982788086 2.02565145492554,217.947982788086 2.01733899116516,217.947418212891 2.00947642326355,217.9462890625 2.00161385536194,217.94514465332 1.99478781223297,217.943832397461 1.98899853229523,217.942352294922L1.98899853229523,217.909378051758 1.99380993843079,217.909378051758C1.99584400653839,217.91015625 1.99824976921082,217.911026000977 2.00102710723877,217.911956787109 2.00380444526672,217.912902832031 2.00660133361816,217.913757324219 2.00941777229309,217.914535522461 2.01278185844421,217.915405273438 2.01606774330139,217.916107177734 2.01927518844604,217.916656494141 2.02248287200928,217.917205810547 2.02576875686646,217.91748046875 2.02913284301758,217.91748046875 2.03609561920166,217.91748046875 2.04190468788147,217.916748046875 2.04655957221985,217.915298461914 2.05121445655823,217.913848876953 2.05471563339233,217.911804199219 2.05706262588501,217.909149169922 2.05940961837769,217.906402587891 2.06105256080627,217.903182983398 2.0619912147522,217.899459838867 2.0629301071167,217.895751953125 2.06339955329895,217.891067504883 2.06339955329895,217.885437011719L2.06339955329895,217.88298034668C2.05878376960754,217.88703918457 2.05344414710999,217.89030456543 2.04738092422485,217.892776489258 2.0413179397583,217.895233154297 2.03507852554321,217.896469116211 2.02866339683533,217.896469116211 2.01160836219788,217.896469116211 1.99844527244568,217.890914916992 1.9891744852066,217.879806518555 1.97990369796753,217.868698120117 1.97526836395264,217.851791381836 1.97526836395264,217.8291015625 1.97526836395264,217.818786621094 1.97669613361359,217.809509277344 1.97955167293549,217.801300048828 1.98240721225739,217.793075561523 1.98637759685516,217.786071777344 1.99146282672882,217.780288696289 1.99631345272064,217.77473449707 2.00218105316162,217.770446777344 2.00906562805176,217.767440795898 2.01595020294189,217.764434814453 2.02310872077942,217.762924194336 2.03054094314575,217.762924194336z" />
    					<PathGeometry FillRule="Nonzero" Figures="M2.20726752281189,217.836502075195C2.20030450820923,217.837203979492 2.19467163085938,217.837814331055 2.19036865234375,217.838317871094 2.1860659122467,217.838821411133 2.18184113502502,217.839828491211 2.17769479751587,217.84130859375 2.17409586906433,217.842559814453 2.17129898071289,217.844467163086 2.16930413246155,217.84700012207 2.16730904579163,217.849548339844 2.16631174087524,217.852935791016 2.16631174087524,217.857162475586 2.16631174087524,217.863342285156 2.16797423362732,217.867584228516 2.17129898071289,217.869888305664 2.17462396621704,217.872192382813 2.17953324317932,217.873352050781 2.18602681159973,217.873352050781 2.18962550163269,217.873352050781 2.19330263137817,217.872528076172 2.19705772399902,217.870880126953 2.20081305503845,217.869247436523 2.20421624183655,217.866928100586 2.20726752281189,217.863967895508L2.20726752281189,217.836502075195z M2.18297553062439,217.762802124023C2.20566368103027,217.762802124023 2.22219061851501,217.766586303711 2.23255681991577,217.774124145508 2.24292278289795,217.781677246094 2.24810576438904,217.793197631836 2.24810576438904,217.808685302734L2.24810576438904,217.898345947266 2.20726752281189,217.898345947266 2.20726752281189,217.884384155273C2.20445108413696,217.886734008789 2.20192790031433,217.88883972168 2.19969820976257,217.890716552734 2.19746851921082,217.892593383789 2.19447612762451,217.894470214844 2.19072079658508,217.896347045898 2.18704390525818,217.898147583008 2.18346452713013,217.899520874023 2.17998313903809,217.900451660156 2.17650175094604,217.901397705078 2.17163157463074,217.901870727539 2.16537284851074,217.901870727539 2.15371584892273,217.901870727539 2.14403438568115,217.89794921875 2.13632822036743,217.89013671875 2.12862205505371,217.882308959961 2.12476897239685,217.872451782227 2.12476897239685,217.860565185547 2.12476897239685,217.850784301758 2.1267249584198,217.842880249023 2.13063669204712,217.836853027344 2.13454842567444,217.830825805664 2.14018130302429,217.826049804688 2.14753532409668,217.822540283203 2.15496754646301,217.818939208984 2.16384720802307,217.816436767578 2.17417430877686,217.815032958984 2.18450117111206,217.813613891602 2.19561052322388,217.812515258789 2.20750212669373,217.811737060547L2.20750212669373,217.81103515625C2.20750212669373,217.803756713867 2.2048225402832,217.798736572266 2.19946360588074,217.795959472656 2.19410443305969,217.793182373047 2.1860659122467,217.791793823242 2.17534780502319,217.791793823242 2.17049717903137,217.791793823242 2.16482520103455,217.792663574219 2.15833163261414,217.79443359375 2.1518383026123,217.796188354492 2.14550113677979,217.798446655273 2.13932061195374,217.801177978516L2.13580012321472,217.801177978516 2.13580012321472,217.769378662109C2.13986825942993,217.768203735352 2.14644002914429,217.766815185547 2.15551519393921,217.765213012695 2.16459035873413,217.763610839844 2.17374396324158,217.762802124023 2.18297553062439,217.762802124023z" />
    					<PathGeometry FillRule="Nonzero" Figures="M2.35743165016174,217.766098022461C2.35876154899597,217.766098022461 2.36024808883667,217.766128540039 2.36189103126526,217.766204833984 2.36353397369385,217.76628112793 2.36502027511597,217.766403198242 2.36635041236877,217.766555786133L2.36635041236877,217.805404663086 2.36294722557068,217.805404663086C2.36138248443604,217.80485534668 2.3591136932373,217.804443359375 2.35614085197449,217.804168701172 2.35316777229309,217.803894042969 2.34988188743591,217.803756713867 2.34628319740295,217.803756713867 2.34198021888733,217.803756713867 2.33746218681335,217.804382324219 2.33272910118103,217.805633544922 2.32799577713013,217.806884765625 2.32339954376221,217.808380126953 2.31894016265869,217.810104370117L2.31894016265869,217.898345947266 2.27786707878113,217.898345947266 2.27786707878113,217.766555786133 2.31894016265869,217.766555786133 2.31894016265869,217.785446166992C2.3208179473877,217.783737182617 2.32341909408569,217.781555175781 2.32674407958984,217.778945922852 2.33006906509399,217.776321411133 2.33310079574585,217.774230957031 2.33583879470825,217.772659301758 2.33881187438965,217.770858764648 2.3422737121582,217.769317626953 2.3462245464325,217.768020629883 2.35017538070679,217.766738891602 2.35391116142273,217.766098022461 2.35743165016174,217.766098022461z" />
    					<PathGeometry FillRule="Nonzero" Figures="M2.44352555274963,217.793792724609C2.43366813659668,217.793792724609 2.42625522613525,217.797225952148 2.42128753662109,217.804107666016 2.41631960868835,217.811004638672 2.4138355255127,217.820617675781 2.4138355255127,217.832977294922 2.4138355255127,217.845962524414 2.41581106185913,217.855361938477 2.41976189613342,217.861145019531 2.42371273040771,217.866928100586 2.43010830879211,217.869827270508 2.4389488697052,217.869827270508 2.44254755973816,217.869827270508 2.44618558883667,217.869125366211 2.44986248016357,217.867721557617 2.45353960990906,217.866302490234 2.45690369606018,217.864395141602 2.45995473861694,217.861968994141L2.45995473861694,217.797302246094C2.45792078971863,217.796295166016 2.45526075363159,217.795440673828 2.45197486877441,217.794784545898 2.44868898391724,217.79411315918 2.44587254524231,217.793792724609 2.44352555274963,217.793792724609z M2.45995473861694,217.715744018555L2.50102806091309,217.715744018555 2.50102806091309,217.898345947266 2.45995473861694,217.898345947266 2.45995473861694,217.884613037109C2.45729494094849,217.886810302734 2.45426321029663,217.88916015625 2.45086002349854,217.891662597656 2.44745683670044,217.894165039063 2.44446444511414,217.896041870117 2.44188261032104,217.89729309082 2.43859672546387,217.898849487305 2.43535017967224,217.900024414063 2.43214249610901,217.900817871094 2.42893481254578,217.901596069336 2.4251012802124,217.901977539063 2.42064189910889,217.901977539063 2.40562105178833,217.901977539063 2.3937292098999,217.895767211914 2.38496708869934,217.883331298828 2.3762047290802,217.870880126953 2.37182354927063,217.854263305664 2.37182354927063,217.833450317383 2.37182354927063,217.82194519043 2.37331008911133,217.811981201172 2.37628293037415,217.803527832031 2.37925601005554,217.795074462891 2.38336324691772,217.787719726563 2.38860487937927,217.781463623047 2.39337730407715,217.775756835938 2.39916658401489,217.771240234375 2.40597295761108,217.767913818359 2.41277933120728,217.764587402344 2.41997694969177,217.762924194336 2.42756581306458,217.762924194336 2.43445038795471,217.762924194336 2.44010281562805,217.763641357422 2.44452309608459,217.765090942383 2.44894337654114,217.766540527344 2.45408725738525,217.768783569336 2.45995473861694,217.771835327148L2.45995473861694,217.715744018555z" />
    					<PathGeometry FillRule="Nonzero" Figures="M2.58880162239075,217.788864135742C2.58082175254822,217.788864135742 2.57458233833313,217.791244506836 2.57008385658264,217.796020507813 2.56558537483215,217.80078125 2.56310153007507,217.807281494141 2.56263208389282,217.815490722656L2.61227202415466,217.815490722656C2.61203718185425,217.80680847168 2.61002278327942,217.800201416016 2.60622835159302,217.795669555664 2.60243391990662,217.791122436523 2.59662508964539,217.788864135742 2.58880162239075,217.788864135742z M2.59196996688843,217.762451171875C2.61215448379517,217.762451171875 2.62733221054077,217.767883300781 2.63750267028809,217.778762817383 2.6476731300354,217.789642333984 2.65275835990906,217.805206298828 2.65275835990906,217.825469970703L2.65275835990906,217.840255737305 2.56274938583374,217.840255737305C2.56314063072205,217.84635925293 2.5644314289093,217.851470947266 2.56662201881409,217.855575561523 2.56881260871887,217.859680175781 2.57170724868774,217.862945556641 2.57530617713928,217.865371704102 2.5788266658783,217.867797851563 2.58293390274048,217.869537353516 2.58762812614441,217.870590209961 2.59232211112976,217.871643066406 2.59744644165039,217.872177124023 2.6030011177063,217.872177124023 2.60777354240417,217.872177124023 2.61246752738953,217.871643066406 2.61708331108093,217.870590209961 2.62169909477234,217.869537353516 2.62592387199402,217.868148803711 2.62975740432739,217.866424560547 2.63312149047852,217.864944458008 2.63623118400574,217.863342285156 2.63908672332764,217.861618041992 2.64194250106812,217.859893798828 2.6442699432373,217.858367919922 2.64606928825378,217.857040405273L2.65041136741638,217.857040405273 2.65041136741638,217.89094543457C2.64704728126526,217.892288208008 2.64397644996643,217.893508911133 2.64119911193848,217.894653320313 2.63842177391052,217.895782470703 2.63460779190063,217.896942138672 2.62975740432739,217.89811706543 2.62529802322388,217.899291992188 2.62070178985596,217.900207519531 2.61596846580505,217.900863647461 2.61123538017273,217.90153503418 2.60546541213989,217.901870727539 2.5986590385437,217.901870727539 2.57378053665161,217.901870727539 2.55471086502075,217.895919799805 2.54145002365112,217.884033203125 2.52818942070007,217.872131347656 2.52155900001526,217.855194091797 2.52155900001526,217.833221435547 2.52155900001526,217.811706542969 2.52773952484131,217.794525146484 2.54010057449341,217.781692504883 2.55246162414551,217.76887512207 2.56975150108337,217.762451171875 2.59196996688843,217.762451171875z" />
    				</GeometryGroup>
    			</GeometryDrawing.Geometry>
    		</GeometryDrawing>
    	</DrawingGroup>
    	<GeometryDrawing x:Name="rect5038_0_3" Brush="#FFF4D3C8">
    		<GeometryDrawing.Geometry>
    			<RectangleGeometry RadiusX="0.0215" RadiusY="0.0215" Rect="0.5576,214.5809,3.1261,0.0914" />
    		</GeometryDrawing.Geometry>
    	</GeometryDrawing>
    </DrawingGroup>


    Merci encore pour les réponses .

  7. #7
    Futur Membre du Club
    j'ai résolue mon problème

    le code suivant ne marchait pas. L'objet DrawingGroup était vide.
    Code :Sélectionner tout -Visualiser dans une fenêtre à part
    1
    2
    3
    4
     
     XmlReader red = ico.CreateReader();
        FileSvgReader Convert = new FileSvgReader(settings);
        DrawingGroup Drawing = Convert.Read(red);

    J'ai donc utilisé directement le Xaml générer par le converter que j'ai splitté pour ensuite le mettre dans un canvas.