Custom control clipping (irregular shape)

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • ppyrstr

    Custom control clipping (irregular shape)

    I have been trying to figure out how to have a custom
    control that is irregular (non-rectangular) not interfere
    with other elements on the screen that may interfere with
    it's "regular" shape (the control defining rectangle).
    For example, if I make a custom control that simply paints
    a circle inside its bounding box, how can I have the
    control not have the area of the control outside of
    the "bounding circle" affect any objects underneath it or
    subsequently placed on top of these new "bounds." Any
    suggestions would be welcome. Thanks.
  • Erik Frey

    #2
    Re: Custom control clipping (irregular shape)

    Check out the Control.Region property.

    Also, for very irregularly shaped regions, you might want to implement
    something like this algorithm to generate your regions:



    Hope that helps,

    Erik

    "ppyrstr" <poopyrooster@h otmail.com> wrote in message
    news:2bd501c379 75$04b45ed0$a60 1280a@phx.gbl.. .[color=blue]
    > I have been trying to figure out how to have a custom
    > control that is irregular (non-rectangular) not interfere
    > with other elements on the screen that may interfere with
    > it's "regular" shape (the control defining rectangle).
    > For example, if I make a custom control that simply paints
    > a circle inside its bounding box, how can I have the
    > control not have the area of the control outside of
    > the "bounding circle" affect any objects underneath it or
    > subsequently placed on top of these new "bounds." Any
    > suggestions would be welcome. Thanks.[/color]


    Comment

    • ppyrstr

      #3
      Re: Custom control clipping (irregular shape)

      Thanks Erik, I'll take a look.
      [color=blue]
      >-----Original Message-----
      > Check out the Control.Region property.
      >
      > Also, for very irregularly shaped regions, you might[/color]
      want to implement[color=blue]
      >something like this algorithm to generate your regions:
      >
      >[/color]
      http://codeguru.earthweb.com/cs_misc...pToRegion.html[color=blue]
      >
      > Hope that helps,
      >
      > Erik
      >
      >"ppyrstr" <poopyrooster@h otmail.com> wrote in message
      >news:2bd501c37 975$04b45ed0$a6 01280a@phx.gbl. ..[color=green]
      >> I have been trying to figure out how to have a custom
      >> control that is irregular (non-rectangular) not[/color][/color]
      interfere[color=blue][color=green]
      >> with other elements on the screen that may interfere[/color][/color]
      with[color=blue][color=green]
      >> it's "regular" shape (the control defining rectangle).
      >> For example, if I make a custom control that simply[/color][/color]
      paints[color=blue][color=green]
      >> a circle inside its bounding box, how can I have the
      >> control not have the area of the control outside of
      >> the "bounding circle" affect any objects underneath it[/color][/color]
      or[color=blue][color=green]
      >> subsequently placed on top of these new "bounds." Any
      >> suggestions would be welcome. Thanks.[/color]
      >
      >
      >.
      >[/color]

      Comment

      Working...