rgny

Hi

Just wondered if theres a crop available in xaml.

For example I have a lot of data that needs to be drawn up which is ok, but if the user requires only part of that drawing to be shown I would like to crop only the required part of the drawing so the user can then explore only this part.

So if i have lots of polylines and shapes and crop them, can a crop be done to the extents of a certain size rectangle so it then becomes the extents of the canvas. If the user then requires to go beyond this then a new canvas would be available, again showing the cropped part of the drawing.

Bit like cropping parts of a large map really

Regards

Richard



Re: Silverlight (formerly WPF/E) Developer Issues cropping xaml

Mark Rideout


Canvas (and anything UIElement based) has a Clip property. Clipping the contents to a rectangle should give you the effect you want:

<Canvas>
<Canvas.Clip>
<RectangleGeometry Rect="50,50,25,25" />
</Canvas.Clip>
</Canvas>

-mark
Program Manager
Microsoft
This post is provided "as-is"




Re: Silverlight (formerly WPF/E) Developer Issues cropping xaml

rgny

Mark

Thanks for this - the magic word being 'clip'

Cheers

Richard