Forums

Missing UIElement ClipToBounds
Last Post 20 Jul 2015 06:50 PM by Filip Dušek. 3 Replies.
Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
dekrollUser is Offline
New Member
New Member
Posts:2


--
20 Jul 2015 05:46 PM
    Hi!

    Is it possible to simulate UIElement.ClipToBounds (https://msdn.microsoft.com/ru-ru/library/system.windows.uielement.cliptobounds(v=vs.110).aspx)?
    I want to draw half of ellipse but I do not see any ways to do this.

    Thanks in advance.
    Filip DušekUser is Offline
    Advanced Member
    Advanced Member
    Posts:676


    --
    20 Jul 2015 06:20 PM
    Hi, You could hide it with ScrollViewer or hide it behind some other control like Border etc., but that's not nice solution. Any clipping is really expensive, maybe better would be to have shape like Arc in MS Blend. I still have more shapes support in my plans.
    dekrollUser is Offline
    New Member
    New Member
    Posts:2


    --
    20 Jul 2015 06:35 PM
    Filip, thanks a lot for quick answer. I've already solve the problem with ScrollViewer but this solution is far from ideal I can see that you already have needsClipBounds field (http://emptykeys.com/EmptyKeysUI/?topic=html/06d821d7-0b67-2034-9105-e1ced5c06931.htm). Maybe you can convert it into property?

    BTW Where I can find project source code or only UI generator is opened?
    Filip DušekUser is Offline
    Advanced Member
    Advanced Member
    Posts:676


    --
    20 Jul 2015 06:50 PM
    Yeah, I can do clipping on few controls (AnimatedImage, Image, TextBlock and ScrollContentPresenter). I was thinking about it before if it's really needed for UIElement like in WPF, maybe in some very special cases, so on the end I pick only those controls. Tho Shapes are bit special, because I'm using directly vertex buffer so there is already Sprite Batch END. I will check it out. Maybe it will be simple for shapes and not performance issue.

    And yeah only UI Generator is OSS at this moment.
    You are not authorized to post a reply.