Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

Matrix transformation or RenderTransform are wrong.

$
0
0

Dear Sir:

Background:

I have attached (SimpleWatch2.svg) working example. There is no issue with that file. Just double click the clock will show in your browser. I can write this application in UWP/WPF/Win2D. This is a proto type so I have written in WPF.

Because I have translated svg (Saleable Vector graph) to WPF, so I have provided each line number of svg file in my WPF application.

The Matrix transformation or RenderTransform are not correct, where same transformation works fine on the web.

For example

<rect x="272.13" y="42.19" width="3.1" height="11.55" transform="translate(-3.51 28.88) rotate(-6)" />

<Rectangle Canvas.Left="272.13"

                      Canvas.Top="42.19"

                      Width="3.1"

                      Height="11.55"

                      Fill="#231f20">

               <Rectangle.RenderTransform>

                   <TransformGroup>

                       <TranslateTransform X="-3.51" Y="28.88" />

                       <RotateTransform Angle="-6" />

                   </TransformGroup>

               </Rectangle.RenderTransform>

           </Rectangle>

<rect x="294.64" y="44.12" width="11.55" height="3.1" transform="matrix(0.01, -1, 1, 0.01, 253.05, 345.82)" />

<Rectangle Canvas.Left="294.64"

                      Canvas.Top="44.12"

                      Width="11.55"

                      Height="3.1"

                      Fill="#231f20">

               <Rectangle.RenderTransform>

                   <MatrixTransform>

                       <MatrixTransform.Matrix>

                           <Matrix M11="0.01"

                                   M12="-1"

                                   M21="1"

                                   M22="0.01"

                                   OffsetX="253.05"

                                   OffsetY="345.82" />

                       </MatrixTransform.Matrix>

                   </MatrixTransform>

                </Rectangle.RenderTransform>

           </Rectangle>  

  Example code

Thanks.


Agha Khan


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>