wpf - How to draw rotated ellipse in C#? -


rotated ellipse means - axes not parallel screen. possible draw winforms? if not possible, how draw wpf? if must use wpf, don't want define in xaml because wanna draw thousands entities cad application.

you can rotate eclipse following xaml used before.

<window x:class="wpfapplication3.mainwindow"         xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"         title="mainwindow" height="350" width="525">     <window.resources>         <storyboard x:key="storyboard1">             <doubleanimationusingkeyframes repeatbehavior="forever" storyboard.targetproperty="(uielement.rendertransform).(transformgroup.children)[2].(rotatetransform.angle)" storyboard.targetname="ball">                 <easingdoublekeyframe keytime="0" value="0"/>                 <easingdoublekeyframe keytime="0:0:1" value="360"/>             </doubleanimationusingkeyframes>         </storyboard>     </window.resources>     <window.triggers>         <eventtrigger routedevent="frameworkelement.loaded">             <beginstoryboard storyboard="{staticresource storyboard1}"/>         </eventtrigger>     </window.triggers>     <grid>          <canvas width="700" height="500">          <grid height="462" width="700" canvas.top="-18">             <grid.columndefinitions>                 <columndefinition width="700*" />                 <columndefinition width="0*" />                 <columndefinition width="0*" />             </grid.columndefinitions>             <ellipse margin="108,88,0,0" name="ball" stroke="black" height="129"                                                                                verticalalignment="top" stretch="uniformtofill" horizontalalignment="left"                                width="128" rendertransformorigin="0.5,0.5">                 <ellipse.rendertransform>                     <transformgroup>                         <scaletransform/>                         <skewtransform/>                         <rotatetransform />                         <translatetransform/>                     </transformgroup>                 </ellipse.rendertransform>                 <ellipse.fill>                     <imagebrush imagesource="c:\users\a tech\desktop\project\2.jpg"/>                 </ellipse.fill>                 <ellipse.bitmapeffect>                     <bevelbitmapeffect bevelwidth="1" />                 </ellipse.bitmapeffect>                 <ellipse.bitmapeffectinput>                     <bitmapeffectinput />                 </ellipse.bitmapeffectinput>             </ellipse>             <rectangle height="13" margin="200,390,0,0" name="pad" stroke="black"                verticalalignment="bottom" fill="black" horizontalalignment="left" width="100" />          </grid>     </canvas>     </grid> </window> 

Comments