Results 1 to 3 of 3

Thread: [RESOLVED] Remove area of graphics

  1. #1

    Thread Starter
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Location
    South Louisiana
    Posts
    9,676

    Resolved [RESOLVED] Remove area of graphics

    I'm wanting to remove an area of a previously used graphics. For example, if I had a rectangle with the following dimensions: (0, 0, 150, 150) and I used Graphics.FillRectangle to fill in that rectangle, how would I be able to remove a smaller rectangle with the following dimensions: (50, 50, 50, 50)?

    I'm sort of looking for the opposite of Graphics.SetClip.

  2. #2
    PowerPoster boops boops's Avatar
    Join Date
    Nov 2008
    Location
    Holland/France
    Posts
    3,128

    Re: Remove area of graphics

    Code:
    e.Graphics.SetClip(rect, CombineMode.Exclude)
    
    'or, if you want to replace the existing clip:
    
    e.Graphics.ExcludeClip(rect)
    [edit: unkind remark about IntelliSense deleted.]

    BB

  3. #3

    Thread Starter
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Location
    South Louisiana
    Posts
    9,676

    Re: Remove area of graphics

    Awesome, thank you boops boops.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width