Skip to main content

Microsoft Silverlight

Answered Question UIElement.Clip - value does not fall within the expected rangeRSS Feed

(0)

nmarun
nmarun

Member

Member

118 points

33 Posts

UIElement.Clip - value does not fall within the expected range

Hi,

I'm trying to get this effect in Silverlight:
http://flash-effects.com/create-wipe-transition-effect/

Below is my xaml:

<Rectangle x:Name="ArunDust" Grid.Column="0" Grid.Row="0"
         Width="250" Height="330" Fill="#FFCABDA9" Opacity="0.655" />
<Image x:Name="testImage" Source="Images/testImage.jpg" Grid.Column="0" Grid.Row="0" />
<Path x:Name="path" Stroke="Azure">
    <Path.Data>
        <PathGeometry x:Name="LeftTopClip">
            <PathFigure StartPoint="1,37">
                <LineSegment x:Name="TopLine" Point="40,37"/>
                <LineSegment x:Name="RightLine" Point="40,80"/>
                <LineSegment x:Name="BottomLine" Point="1,80" />
                <LineSegment Point="1, 37" />
            </PathFigure>
        </PathGeometry>
    </Path.Data>
</Path>
<Button x:Name="btnPlay" Content="Play" Click="btnPlay_Click"
        Grid.Column="1" Grid.Row="0" Width="40" Height="30"/> 

 My code-behind:

public Page()
{
    InitializeComponent();

    // exception occurs at this line:
    testImage.Clip = LeftTopClip;
}

I get this exception:
{System.ArgumentException: Value does not fall within the expected range.
   at MS.Internal.XcpImports.CheckHResult(UInt32 hr)
   at MS.Internal.XcpImports.SetValue(INativeCoreTypeWrapper obj, DependencyProperty property, DependencyObject doh)
   at System.Windows.DependencyObject.SetValue(DependencyProperty property, DependencyObject doh)
   at System.Windows.UIElement.set_Clip(Geometry value)
   at ImageWipe.Page..ctor()
   at ImageWipe.App.Application_Startup(Object sender, StartupEventArgs e)
   at System.Windows.CoreInvokeHandler.InvokeEventHandler(Int32 typeIndex, Delegate handlerDelegate, Object sender, Object args)
   at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, String eventName)}

Please let me know if there is another way to get this done. I don't want to use the 'make clipping path' in Blend as this will remove my 'path' object and hard-code it into the image object.

Thanks
Arun

nmarun
nmarun

Member

Member

118 points

33 Posts

Answered Question

Re: UIElement.Clip - value does not fall within the expected range

This is no longer an issue for me. Please close the ticket.

  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities