Select to view content in your preferred language

Change ScaleTransform ScaleX at runtime for a markersymbol

671
1
08-22-2011 09:25 AM
AlirezaAhmadi
Emerging Contributor
is it possible to change ScaleTransform ScaleX and ScaleY at runtime for a markersymbol? How?
0 Kudos
1 Reply
JenniferNery
Esri Regular Contributor
You can look at custom symbols here: http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#CustomSymbols.

In the MarkerSymbol.ControlTemplate, you can update your Storyboard and Rectangle to include ScaleTransform. In the example above replace Storyboard for Selection for 'SelectRectangleMarkerSymbol' with this:

<Storyboard>
 <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" 
 Duration="00:00:00.0010000" Storyboard.TargetName="myrectangle" 
 Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleX)">
  <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0.9"/>
 </DoubleAnimationUsingKeyFrames>
 <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" 
 Duration="00:00:00.0010000" Storyboard.TargetName="myrectangle" 
 Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleY)">
  <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0.9"/>        
 </DoubleAnimationUsingKeyFrames>
</Storyboard>


and add RenderTransform.ScaleTransform to the Rectangle:
 <Rectangle.RenderTransform>
  <ScaleTransform />
 </Rectangle.RenderTransform>
0 Kudos