System.Drawing.Rectangle.Intersect(System.Drawing.Rectangle)

Here are the examples of the csharp api class System.Drawing.Rectangle.Intersect(System.Drawing.Rectangle) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

129 Examples 7

1. Example

Project: MapleShark
Source File: VisibleNestedPaneCollection.cs
private void CalculateBounds()
		{
			if (Count == 0)
				return;

			this[0].NestedDockingStatus.Se/n ..... /n //View Source file for more details /n }

2. Example

Project: dockpanelsuite
Source File: VisibleNestedPaneCollection.cs
private void CalculateBounds()
        {
            if (Count == 0)
                return;

      /n ..... /n //View Source file for more details /n }

3. Example

Project: ArnoldSimulator
Source File: VisibleNestedPaneCollection.cs
private void CalculateBounds()
        {
            if (Count == 0)
                return;

      /n ..... /n //View Source file for more details /n }

4. Example

Project: lua-tilde
Source File: VisibleNestedPaneCollection.cs
private void CalculateBounds()
		{
			if (Count == 0)
				return;

			this[0].NestedDockingStatus.Se/n ..... /n //View Source file for more details /n }

5. Example

Project: Nexus-Mod-Manager
Source File: VisibleNestedPaneCollection.cs
private void CalculateBounds()
        {
            if (Count == 0)
                return;

      /n ..... /n //View Source file for more details /n }

6. Example

Project: partcover.net4
Source File: TextControl.cs
protected override void OnPaint(PaintEventArgs e)
        {
            var clip = e.ClipRectangle;
            clip.Intersect(ViewRectangle);
            view.Draw(e.Graphics, clip);
        }

7. Example

Project: ShareX
Source File: ImageHelper.cs
public static Rectangle CreateIntersectRectangle(Size applySize, Rectangle rect, bool invert)
        {
            Rectangle myRect;
            if (invert)
            {
                myRect = new Rectangle(0, 0, applySize.Width, applySize.Height);
            }
            else
            {
                Rectangle applyRect = new Rectangle(0, 0, applySize.Width, applySize.Height);
                myRect = new Rectangle(rect.X, rect.Y, rect.Width, rect.Height);
                myRect.Intersect(applyRect);
            }
            return myRect;
        }

8. Example

Project: ShareX
Source File: ShapeManager.cs
public Image CropImage(Rectangle rect, bool onlyIfSizeDifferent = false)
        {
            rect = CaptureHelpers.ScreenToClient(rect);

            Point offset = CaptureHelpers.ScreenToClient(Form.CanvasRectangle.Location);

            rect.X -= offset.X;
            rect.Y -= offset.Y;

            rect.Intersect(new Rectangle(0, 0, Form.Canvas.Width, Form.Canvas.Height));

            if (rect.IsValid() && (!onlyIfSizeDifferent || rect.Size != Form.Canvas.Size))
            {
                return ImageHelpers.CropBitmap((Bitmap)Form.Canvas, rect);
            }

            return null;
        }

9. Example

Project: ynoteclassic
Source File: VisibleNestedPaneCollection.cs
private void CalculateBounds()
        {
            if (Count == 0)
                return;

      /n ..... /n //View Source file for more details /n }

10. Example

Project: ShareX
Source File: ImageHelper.cs
public static Rectangle CreateIntersectRectangle(Size applySize, Rectangle rect, bool invert)
        {
            Rectangle myRect;
            if (invert)
            {
                myRect = new Rectangle(0, 0, applySize.Width, applySize.Height);
            }
            else
            {
                Rectangle applyRect = new Rectangle(0, 0, applySize.Width, applySize.Height);
                myRect = new Rectangle(rect.X, rect.Y, rect.Width, rect.Height);
                myRect.Intersect(applyRect);
            }
            return myRect;
        }

11. Example

Project: SquareOne
Source File: VisibleNestedPaneCollection.cs
private void CalculateBounds()
        {
            if (Count == 0)
                return;

      /n ..... /n //View Source file for more details /n }

12. Example

Project: ceptr
Source File: DisplayingDockList.cs
private void CalculateBounds()
		{
			if (Count == 0)
				return;

			this[0].NestedDockingStatus.Se/n ..... /n //View Source file for more details /n }

13. Example

Project: ceptr
Source File: VisibleNestedPaneCollection.cs
private void CalculateBounds()
		{
			if (Count == 0)
				return;

			this[0].NestedDockingStatus.Se/n ..... /n //View Source file for more details /n }

14. Example

Project: Zydeo
Source File: MainForm.cs
private bool verifySizeAndLoc(Size size, Point loc)
        {
            // Minimum value means no /n ..... /n //View Source file for more details /n }

15. Example

Project: ClearCanvas
Source File: Roi.cs
public Rectangle GetBoundingBoxRounded(bool constrainToImage)
		{
			Rectangle bounds = RectangleUtilities.RoundInflate(BoundingBox);
			if (constrainToImage)
			{
				bounds.Intersect(new Rectangle(0, 0, ImageSize.Width - 1, ImageSize.Height - 1));
			}

			return bounds;
		}

16. Example

Project: HOPE
Source File: DisplayingDockList.cs
private void CalculateBounds()
		{
			if (Count == 0)
				return;

			this[0].NestedDockingStatus.Se/n ..... /n //View Source file for more details /n }

17. Example

Project: HOPE
Source File: VisibleNestedPaneCollection.cs
private void CalculateBounds()
		{
			if (Count == 0)
				return;

			this[0].NestedDockingStatus.Se/n ..... /n //View Source file for more details /n }

18. Example

Project: dockpanelsuite
Source File: VS2003DockPaneStrip.cs
public override GraphicsPath GetOutline(int index)
        {
            Point[] pts = new Point[8];/n ..... /n //View Source file for more details /n }

19. Example

Project: dockpanelsuite
Source File: VS2003DockPaneStrip.cs
protected override int HitTest(Point point)
        {
            Rectangle rectTabStrip = TabsRectangle;

            for (int i=0; i<Tabs.Count; i++)
            {
                Rectangle rectTab = Tabs[i].Rectangle.Value;
                rectTab.Intersect(rectTabStrip);
                if (rectTab.Contains(point))
                    return i;
            }
            return -1;
        }

20. Example

Project: server
Source File: Creature.cs
public virtual bool Walk(Direction direction)
        {
            int oldX = X, oldY = Y, newX = X/n ..... /n //View Source file for more details /n }

21. Example

Project: gitter
Source File: ViewHost.cs
public Rectangle GetDockBounds(ViewHost viewHost, DockResult dockResult)
		{
			Verify.Argument.IsNo/n ..... /n //View Source file for more details /n }

22. Example

Project: P
Source File: MainWindow.xaml.cs
private void RestorePosition()
        {
            this.SizeChanged -= OnWindowSizeChanged;
      /n ..... /n //View Source file for more details /n }

23. Example

Project: ATF
Source File: CanvasControl.cs
private Rectangle MakeSelectionRect(Point p1, Point p2)
        {
            Rectangle rect =  GdiUtil.MakeRectangle(p1, p2);
            rect.Intersect(VisibleClientRectangle);
            rect = RectangleToScreen(rect);
            return rect;
        }

24. Example

Project: SkinFramework
Source File: ImageStrip.cs
public void Draw(Graphics g, int index, Rectangle destRect, Rectangle srcRect,
        DrawingAlign /n ..... /n //View Source file for more details /n }

25. Example

Project: ArnoldSimulator
Source File: VS2003DockPaneStrip.cs
protected internal override GraphicsPath GetOutline(int index)
        {
            Point[] pts = n/n ..... /n //View Source file for more details /n }

26. Example

Project: ArnoldSimulator
Source File: VS2003DockPaneStrip.cs
protected internal override int HitTest(Point ptMouse)
        {
            Rectangle rectTabStrip = TabsRectangle;

            for (int i=0; i<Tabs.Count; i++)
            {
                Rectangle rectTab = GetTabRectangle(i);
                rectTab.Intersect(rectTabStrip);
                if (rectTab.Contains(ptMouse))
                    return i;
            }
            return -1;
        }

27. Example

Project: fdotoolbox
Source File: TextArea.cs
protected override void OnPaint(System.Windows.Forms.PaintEventArgs e)
		{
			int currentXPos = 0;
	/n ..... /n //View Source file for more details /n }

28. Example

Project: OpenLiveWriter
Source File: ImageCropControl.cs
public virtual Rectangle GetNewBounds(Point newLoc)
            {
                Rectangle newRect = initialBounds;

                if (anchor == ANCHOR_ALL) // move
                {
                    newRect = DoMove(newLoc);
                }
                else // resize
                {
                    newRect = DoResize(newLoc);
                }

                if (container != null)
                    newRect.Intersect(container.Value);

                return newRect;
            }

29. Example

Project: ShareX
Source File: ImageHelper.cs
public static bool Crop(ref Image image, ref Rectangle cropRectangle)
        {
            Image returnImage = null;
            if (image != null && image is Bitmap && ((image.Width * image.Height) > 0))
            {
                cropRectangle.Intersect(new Rectangle(0, 0, image.Width, image.Height));
                if (cropRectangle.Width != 0 || cropRectangle.Height != 0)
                {
                    returnImage = CloneArea(image, cropRectangle, PixelFormat.DontCare);
                    image.Dispose();
                    image = returnImage;
                    return true;
                }
            }
            LOG.Warn("Can't crop a null/zero size image!");
            return false;
        }

30. Example

Project: ShareX
Source File: DrawableContainer.cs
public virtual void DrawContent(Graphics graphics, Bitmap bmp, RenderMode renderMode, Rectangle clip/n ..... /n //View Source file for more details /n }

31. Example

Project: ynoteclassic
Source File: VS2003DockPaneStrip.cs
protected internal override GraphicsPath GetOutline(int index)
        {
            Point[] pts = n/n ..... /n //View Source file for more details /n }

32. Example

Project: ynoteclassic
Source File: VS2003DockPaneStrip.cs
protected internal override int HitTest(Point ptMouse)
        {
            Rectangle rectTabStrip = TabsRectangle;

            for (int i = 0; i < Tabs.Count; i++)
            {
                Rectangle rectTab = GetTabRectangle(i);
                rectTab.Intersect(rectTabStrip);
                if (rectTab.Contains(ptMouse))
                    return i;
            }
            return -1;
        }

33. Example

Project: ShareX
Source File: ImageHelper.cs
public static bool Crop(ref Image image, ref Rectangle cropRectangle)
        {
            Image returnImage = null;
            if (image != null && image is Bitmap && ((image.Width * image.Height) > 0))
            {
                cropRectangle.Intersect(new Rectangle(0, 0, image.Width, image.Height));
                if (cropRectangle.Width != 0 || cropRectangle.Height != 0)
                {
                    returnImage = CloneArea(image, cropRectangle, PixelFormat.DontCare);
                    image.Dispose();
                    image = returnImage;
                    return true;
                }
            }
            LOG.Warn("Can't crop a null/zero size image!");
            return false;
        }

34. Example

Project: ShareX
Source File: DrawableContainer.cs
public virtual void DrawContent(Graphics graphics, Bitmap bmp, RenderMode renderMode, Rectangle clip/n ..... /n //View Source file for more details /n }

35. Example

Project: SquareOne
Source File: VS2003DockPaneStrip.cs
protected override GraphicsPath GetOutline(int index)
        {
            Point[] pts = new Point[/n ..... /n //View Source file for more details /n }

36. Example

Project: SquareOne
Source File: VS2003DockPaneStrip.cs
protected override int HitTest(Point ptMouse)
        {
            Rectangle rectTabStrip = TabsRectangle;

            for (int i=0; i<Tabs.Count; i++)
            {
                Rectangle rectTab = GetTabRectangle(i);
                rectTab.Intersect(rectTabStrip);
                if (rectTab.Contains(ptMouse))
                    return i;
            }
            return -1;
        }

37. Example

Project: ceptr
Source File: DockPaneStripVS2003.cs
protected internal override int GetHitTest(Point ptMouse)
		{
			Rectangle rectTabStrip = TabsRectangle;

			for (int i=0; i<Tabs.Count; i++)
			{
				Rectangle rectTab = GetTabRectangle(i);
				rectTab.Intersect(rectTabStrip);
				if (rectTab.Contains(ptMouse))
					return i;
			}
			return -1;
		}

38. Example

Project: winforms
Source File: TimelineViewTrack.cs
public void InvalidateLeftSidebar()
		{
			if (this.parentView == null) return;

			Rectangle trackRect = this.parentView.GetTrackRectangle(this);
			Rectangle rectOnParent;
			Rectangle targetRect;

			rectOnParent = trackRect;
			targetRect = new Rectangle(
				rectOnParent.X,
				rectOnParent.Y,
				this.parentView.LeftSidebarSize,
				rectOnParent.Height);
			rectOnParent.Intersect(targetRect);
			rectOnParent.Intersect(this.parentView.ClientRectangle);
			if (!rectOnParent.IsEmpty)
			{
				this.parentView.Invalidate(rectOnParent);
			}
		}

39. Example

Project: winforms
Source File: TimelineViewTrack.cs
public void InvalidateRightSidebar()
		{
			if (this.parentView == null) return;

			Rectangle trackRect = this.parentView.GetTrackRectangle(this);
			Rectangle rectOnParent;
			Rectangle targetRect;

			rectOnParent = trackRect;
			targetRect = new Rectangle(
				rectOnParent.Right - this.parentView.RightSidebarSize,
				rectOnParent.Y,
				this.parentView.RightSidebarSize,
				rectOnParent.Height);
			rectOnParent.Intersect(targetRect);
			rectOnParent.Intersect(this.parentView.ClientRectangle);
			if (!rectOnParent.IsEmpty)
			{
				this.parentView.Invalidate(rectOnParent);
			}
		}

40. Example

Project: HOPE
Source File: DockPaneStripVS2003.cs
protected internal override int GetHitTest(Point ptMouse)
		{
			Rectangle rectTabStrip = TabsRectangle;

			for (int i=0; i<Tabs.Count; i++)
			{
				Rectangle rectTab = GetTabRectangle(i);
				rectTab.Intersect(rectTabStrip);
				if (rectTab.Contains(ptMouse))
					return i;
			}
			return -1;
		}

41. Example

Project: dockpanelsuite
Source File: VS2005DockPaneStrip.cs
private GraphicsPath GetOutline_Document(int index)
        {
            Rectangle rectTab = Tabs[i/n ..... /n //View Source file for more details /n }

42. Example

Project: dockpanelsuite
Source File: VS2005DockPaneStrip.cs
private GraphicsPath GetOutline_ToolWindow(int index)
        {
            Rectangle rectTab = Tabs[index].Rectangle.Value;
            rectTab.Intersect(TabsRectangle);
            rectTab = RectangleToScreen(DrawHelper.RtlTransform(this, rectTab));
            Rectangle rectPaneClient = DockPane.RectangleToScreen(DockPane.ClientRectangle);

            GraphicsPath path = new GraphicsPath();
            GraphicsPath pathTab = GetTabOutline(Tabs[index], true, true);
            path.AddPath(pathTab, true);
            path.AddLine(rectTab.Left, rectTab.Top, rectPaneClient.Left, rectTab.Top);
            path.AddLine(rectPaneClient.Left, rectTab.Top, rectPaneClient.Left, rectPaneClient.Top);
            path.AddLine(rectPaneClient.Left, rectPaneClient.Top, rectPaneClient.Right, rectPaneClient.Top);
            path.AddLine(rectPaneClient.Right, rectPaneClient.Top, rectPaneClient.Right, rectTab.Top);
            path.AddLine(rectPaneClient.Right, rectTab.Top, rectTab.Right, rectTab.Top);
            return path;
        }

43. Example

Project: dockpanelsuite
Source File: VS2003AutoHideStrip.cs
protected override IDockContent HitTest(Point point)
        {
            foreach(DockState state in DockStates)
            {
                Rectangle rectTabStrip = GetLogicalTabStripRectangle(state, true);
                if (!rectTabStrip.Contains(point))
                    continue;

                foreach(Pane pane in GetPanes(state))
                {
                    foreach(TabVS2003 tab in pane.AutoHideTabs)
                    {
                        Rectangle rectTab = GetTabRectangle(tab, true);
                        rectTab.Intersect(rectTabStrip);
                        if (rectTab.Contains(point))
                            return tab.Content;
                    }
                }
            }
            
            return null;
        }

44. Example

Project: dockpanelsuite
Source File: VS2005MultithreadingDockPaneStrip.cs
private GraphicsPath GetOutline_Document(int index)
        {
            Rectangle rectTab = Tabs[i/n ..... /n //View Source file for more details /n }

45. Example

Project: dockpanelsuite
Source File: VS2005MultithreadingDockPaneStrip.cs
private GraphicsPath GetOutline_ToolWindow(int index)
        {
            Rectangle rectTab = Tabs[index].Rectangle.Value;
            rectTab.Intersect(TabsRectangle);
            rectTab = RectangleToScreen(DrawHelper.RtlTransform(this, rectTab));
            Rectangle rectPaneClient = DockPane.RectangleToScreen(DockPane.ClientRectangle);

            GraphicsPath path = new GraphicsPath();
            GraphicsPath pathTab = GetTabOutline(Tabs[index], true, true);
            path.AddPath(pathTab, true);
            path.AddLine(rectTab.Left, rectTab.Top, rectPaneClient.Left, rectTab.Top);
            path.AddLine(rectPaneClient.Left, rectTab.Top, rectPaneClient.Left, rectPaneClient.Top);
            path.AddLine(rectPaneClient.Left, rectPaneClient.Top, rectPaneClient.Right, rectPaneClient.Top);
            path.AddLine(rectPaneClient.Right, rectPaneClient.Top, rectPaneClient.Right, rectTab.Top);
            path.AddLine(rectPaneClient.Right, rectTab.Top, rectTab.Right, rectTab.Top);
            return path;
        }

46. Example

Project: dockpanelsuite
Source File: VS2012DockPaneStrip.cs
private GraphicsPath GetOutline_Document(int index)
        {
            Rectangle rectTab = Tabs[i/n ..... /n //View Source file for more details /n }

47. Example

Project: dockpanelsuite
Source File: VS2012DockPaneStrip.cs
private GraphicsPath GetOutline_ToolWindow(int index)
        {
            Rectangle rectTab = Tabs[index].Rectangle.Value;
            rectTab.Intersect(TabsRectangle);
            rectTab = RectangleToScreen(DrawHelper.RtlTransform(this, rectTab));
            Rectangle rectPaneClient = DockPane.RectangleToScreen(DockPane.ClientRectangle);

            GraphicsPath path = new GraphicsPath();
            GraphicsPath pathTab = GetTabOutline(Tabs[index], true, true);
            path.AddPath(pathTab, true);
            path.AddLine(rectTab.Left, rectTab.Top, rectPaneClient.Left, rectTab.Top);
            path.AddLine(rectPaneClient.Left, rectTab.Top, rectPaneClient.Left, rectPaneClient.Top);
            path.AddLine(rectPaneClient.Left, rectPaneClient.Top, rectPaneClient.Right, rectPaneClient.Top);
            path.AddLine(rectPaneClient.Right, rectPaneClient.Top, rectPaneClient.Right, rectTab.Top);
            path.AddLine(rectPaneClient.Right, rectTab.Top, rectTab.Right, rectTab.Top);
            return path;
        }

48. Example

Project: dockpanelsuite
Source File: VS2012DockPaneStrip.cs
private GraphicsPath GetTabOutline_Document(Tab tab, bool rtlTransform, bool toScreen, bool full)
        {
            GraphicsPath.Reset();
            Rectangle rect = GetTabRectangle(Tabs.IndexOf(tab));

            // Shorten TabOutline so it doesn't get overdrawn by icons next to it
            rect.Intersect(TabsRectangle);
            rect.Width--;

            if (rtlTransform)
                rect = DrawHelper.RtlTransform(this, rect);
            if (toScreen)
                rect = RectangleToScreen(rect);

            GraphicsPath.AddRectangle(rect);
            return GraphicsPath;
        }

49. Example

Project: dockpanelsuite
Source File: VS2013DockPaneStrip.cs
private GraphicsPath GetOutline_Document(int index)
        {
            Rectangle rectTab = Tabs[i/n ..... /n //View Source file for more details /n }

50. Example

Project: dockpanelsuite
Source File: VS2013DockPaneStrip.cs
private GraphicsPath GetOutline_ToolWindow(int index)
        {
            Rectangle rectTab = Tabs[index].Rectangle.Value;
            rectTab.Intersect(TabsRectangle);
            rectTab = RectangleToScreen(DrawHelper.RtlTransform(this, rectTab));
            Rectangle rectPaneClient = DockPane.RectangleToScreen(DockPane.ClientRectangle);

            GraphicsPath path = new GraphicsPath();
            GraphicsPath pathTab = GetTabOutline(Tabs[index], true, true);
            path.AddPath(pathTab, true);
            path.AddLine(rectTab.Left, rectTab.Top, rectPaneClient.Left, rectTab.Top);
            path.AddLine(rectPaneClient.Left, rectTab.Top, rectPaneClient.Left, rectPaneClient.Top);
            path.AddLine(rectPaneClient.Left, rectPaneClient.Top, rectPaneClient.Right, rectPaneClient.Top);
            path.AddLine(rectPaneClient.Right, rectPaneClient.Top, rectPaneClient.Right, rectTab.Top);
            path.AddLine(rectPaneClient.Right, rectTab.Top, rectTab.Right, rectTab.Top);
            return path;
        }