Search
Module:
Directory

   Desktop Functions:

   Smart Device Functions:


Show Recent Changes
Subscribe (RSS)
Misc. Pages
Comments
FAQ
Helpful Tools
Playground
Suggested Reading
Website TODO List
Download Visual Studio Add-In

Search Results for "Rectangle" in [All]

hhctrl

.

        public RECT(Rectangle r)

gdiplus

.

static extern int GdipAddPathRectanglesI(HandleRef path,

.

Declare Function GdipAddPathRectanglesI Lib "gdiplus.dll" (TODO) As TODO

.
Documentation
[GdipAddPathRectanglesI] on MSDN
.

static extern int GdipAddPathRectangleI(HandleRef path, int x, int y,

.

Declare Function GdipAddPathRectangleI Lib "gdiplus.dll" (TODO) As TODO

.
Documentation
[GdipAddPathRectangleI] on MSDN
.

static extern int GdipAddPathRectangles(HandleRef path,

.

Declare Function GdipAddPathRectangles Lib "gdiplus.dll" (TODO) As TODO

.
Documentation
[GdipAddPathRectangles] on MSDN

Constants

5: EMR_
.

        EMR_RECTANGLE          = 43,

.

        /// Invalid rectangle

7: WM
.
WM_MOVING 0x216 The WM_MOVING message is sent to a window that the user is moving. By processing this message, an application can monitor the position of the drag rectangle and, if needed, change its position.
.
WM_SIZING 0x214 The WM_SIZING message is sent to a window that the user is resizing. By processing this message, an application can monitor the size and position of the drag rectangle and, if needed, change its size or position.

uxtheme

.

Public Declare Function GetThemePartSize Lib "uxtheme.dll" (ByVal hTheme As IntPtr, ByVal hdc As IntPtr, ByVal iPartId As Integer, ByVal iStateId As Integer, ByRef prc As Rectangle, ByVal eSize As THEMESIZE, ByRef psz As Size) As Integer

ole32

.

       public static extern int OleDraw(IntPtr pUnk, int dwAspect, IntPtr hdcDraw, ref Rectangle lprcBounds);

.

           Rectangle rect = new Rectangle(0,

.

                          c.ClientRectangle.Width,

.

                          c.ClientRectangle.Height);

shell32

.

///         Retrieves the bounding rectangle of the Windows taskbar. Note that this applies only to the

.

Retrieves the Notifyicon bounding rectangle.

.

Retrieves the Notifyicon bounding rectangle.

coredll

.
Summary
Invalidates the specified rectangle for the specified window handle
.

    /// Invalidates a rectangle for a given window

.

    /// <param name="rect">Rectangle to invalidate</param>

.

    public extern static void InvalidateRect( IntPtr handle, Rectangle rect, bool erase );

.

    /// Invalidates a rectangle for a given control

.

    /// <param name="rect">Rectangle to invalidate</param>

.

    public static void InvalidateRect( Control control, Rectangle rect, bool erase )

.

    /// <param name="erase">Rectangle to invalidate</param>

.
Summary
Invalidates the specified rectangle for the specified window handle
.

    /// Invalidates a rectangle for a given window

.

    /// <param name="rect">Rectangle to invalidate</param>

.

    public extern static void InvalidateRect( IntPtr handle, Rectangle rect, bool erase );

.

    /// Invalidates a rectangle for a given control

.

    /// <param name="rect">Rectangle to invalidate</param>

.

    public static void InvalidateRect( Control control, Rectangle rect, bool erase )

.

    /// <param name="erase">Rectangle to invalidate</param>

.

[DllImport("coredll", EntryPoint="Rectangle", SetLastError=true)]

.

private static extern uint RectangleCE(IntPtr hdc, int nLeftRect, int nTopRect, int nRightRect, int nBottomRect);

.

Declare Function Rectangle Lib "coredll.dll" (TODO) As TODO

.
Documentation
[Rectangle] on MSDN

user32

.

static extern TODO ClientRectangle(TODO);

.

Declare Function ClientRectangle Lib "user32.dll" (TODO) As TODO

.
Documentation
[ClientRectangle] on MSDN
.

Control.RectangleToScreen

.

    /// Left position of the rectangle.

.

    /// Top position of the rectangle.

.

    /// Right position of the rectangle.

.

    /// Bottom position of the rectangle.

.

    /// Operator to convert a RECT to Drawing.Rectangle.

.

    /// <param name="rect">Rectangle to convert.</param>

.

    /// <returns>A Drawing.Rectangle</returns>

.

    public static implicit operator Rectangle(RECT rect)

.

        return Rectangle.FromLTRB(rect.Left, rect.Top, rect.Right, rect.Bottom);

.

    /// Operator to convert Drawing.Rectangle to a RECT.

.

    /// <param name="rect">Rectangle to convert.</param>

.

    /// <returns>RECT rectangle.</returns>

.

    public static implicit operator RECT(Rectangle rect)

.

Since only IDANI_CAPTION is implemented, to get the effect of IDANI_OPEN, simply swap the lprcFrom and lprcTo rectangles, but still specify the IDANI_CAPTION constant.

.

      public RECT(System.Drawing.Rectangle rectangle)

.

        Left = rectangle.Left;

.

        Top = rectangle.Top;

.

        Right = rectangle.Right;

.

        Bottom = rectangle.Bottom;

.

    RECT(System::Drawing::Rectangle rectangle) {

.

        Left = rectangle.Left;

.

        Top = rectangle.Top;

.

        Right = rectangle.Right;

.

        Bottom = rectangle.Bottom;

.

        // The following style can be used to adjust the bounding rectangle of the push button.

.

        /// Bounding rectangle is adjusted to exclude the surrounding edge of the push button.

.

The Win32 RECT structure is not compatible with the .NET System.Drawing.Rectangle structure.

.

ClientRectangle property of the System.Windows.Forms.Control class

.

    /// <summary>DCX_WINDOW: Returns a DC that corresponds to the window rectangle rather

.

    /// than the client rectangle.</summary>

.

        public System.Drawing.Rectangle rcCaret;

.

        public System.Drawing.Rectangle rcCaret;

.

    public Rectangle rcScrollBar;

.

This didn't work for me with the Rectangle type for SCROLLBARINFO.rcScrollBar. To rectify this I altered this declaration to type RECT using the following standard definition.

.

        public System.Drawing.Rectangle rcNormalPosition;

.

The Win32 RECT is not binary compatible with System.Drawing.Rectangle.

.

Rectangle myRect = new Rectangle();

.
Summary
The InflateRect API function increases or decreases the width and height of the specified rectangle. The InflateRect function adds dx units to the left and right ends of the rectangle and dy units to the top and bottom. The dx and dy parameters are signed values; positive values increase the width and height, and negative values decrease them.
.
Summary
The InvalidateRect API. From MSDN: The InvalidateRect function adds a rectangle to the specified window's update region. The update region represents the portion of the window's client area that must be redrawn.
.

Public Overloads Shared Function InvalidateRect(ByVal hWnd As Int32, ByVal lpRect As System.Drawing.Rectangle, ByVal bErase As Boolean) As Boolean

.

     Return InvalidateRect(hWnd, RECT.FromRectangle(lpRect), bErase)

.
Context
POINT and RECT structures are defined elsewhere. you've gotten the rectangle (RECT) you wish to highlight
.

Rectangle R;

.

/** draw a red border around your rectangle **/

.

/** when you want to clear this rectangle, use this **/

.

Invalidate(Rectangle rect) - Adds the specified rectangle to the update region of the control

.

Invalidate(Rectangle rect, bool invalidateChildern) - combination of the previous two.

.

Invalidate(Rectangle rect) - Adds the specified rectangle to the update region of the control and causes a paint message to be sent to the control.

.

Invalidate(Rectangle rect, bool invalidateChildern) - combination of the previous two.

.

   public static System.Drawing.Rectangle MapRectangle(this System.Windows.Forms.IWin32Window ctrl, System.Drawing.Rectangle rectangle, System.Windows.Forms.IWin32Window newWin = null)

.

     NativeMethods.RECT ir = rectangle;

.

Consider System.Windows.Forms.Screen class and its FromRectangle.

.

    /// A RECT structure that specifies the display monitor rectangle, expressed in virtual-screen coordinates.

.

    /// Note that if the monitor is not the primary display monitor, some of the rectangle's coordinates may be negative values.

.

    /// A RECT structure that specifies the work area rectangle of the display monitor that can be used by applications,

.

    /// expressed in virtual-screen coordinates. Windows uses this rectangle to maximize an application on the monitor.

.

    /// Note that if the monitor is not the primary display monitor, some of the rectangle's coordinates may be negative values.

.

    /// The RECT structure defines the coordinates of the upper-left and lower-right corners of a rectangle.

.

    /// By convention, the right and bottom edges of the rectangle are normally considered exclusive.

.

    /// In other words, the pixel whose coordinates are ( right, bottom ) lies immediately outside of the the rectangle.

.

    /// For example, when RECT is passed to the FillRect function, the rectangle is filled up to, but not including,

.

    /// The x-coordinate of the upper-left corner of the rectangle.

.

    /// The y-coordinate of the upper-left corner of the rectangle.

.

    /// The x-coordinate of the lower-right corner of the rectangle.

.

    /// The y-coordinate of the lower-right corner of the rectangle.

.

    /// A RECT structure that specifies the display monitor rectangle, expressed in virtual-screen coordinates.

.

    /// Note that if the monitor is not the primary display monitor, some of the rectangle's coordinates may be negative values.

.

    /// A RECT structure that specifies the work area rectangle of the display monitor that can be used by applications,

.

    /// expressed in virtual-screen coordinates. Windows uses this rectangle to maximize an application on the monitor.

.

    /// Note that if the monitor is not the primary display monitor, some of the rectangle's coordinates may be negative values.

.

    /// The RECT structure defines the coordinates of the upper-left and lower-right corners of a rectangle.

.

    /// By convention, the right and bottom edges of the rectangle are normally considered exclusive.

.

    /// In other words, the pixel whose coordinates are ( right, bottom ) lies immediately outside of the the rectangle.

.

    /// For example, when RECT is passed to the FillRect function, the rectangle is filled up to, but not including,

.

    /// The x-coordinate of the upper-left corner of the rectangle.

.

    /// The y-coordinate of the upper-left corner of the rectangle.

.

    /// The x-coordinate of the lower-right corner of the rectangle.

.

    /// The y-coordinate of the lower-right corner of the rectangle.

.

    Dim pt As Point = picClicker.PointToScreen(New Point(picClicker.ClientRectangle.Width / 2, picClicker.ClientRectangle.Height / 2))

.
Context
using ScreenToClient to convert to a managed Rectangle. hWnd is assumed to be the handle to the form/control you need coords for
.

Rectangle R = new Rectangle(topLeft.X, topLeft.Y, width, height);

.

    public System.Drawing.Rectangle rcNormalPosition;

.

             "rectangle ", inRect.Left.ToString, ", ", inRect.Top.ToString, ", ", inRect.Right.ToString, _

.

Public Overloads Shared Function ValidateRect(ByVal hWnd As IntPtr, ByVal lpRect As System.Drawing.Rectangle) As Boolean

.

     Return ValidateRect(hWnd, RECT.FromRectangle(lpRect))

.

In the Win32 API, it is valid to specify a value of "NULL" to lpRect. Use IntPtr.Zero in C#. This will validate the entire rectangle.

Structures

.

    public Rectangle Exclude

.

      get { return (Rectangle)Marshal.PtrToStructure(prcExclude, typeof(RECT)); }

.

// containing a geocoordinate rectangle

.

   public bool ReturnCalculatedRectangle

.

    An array of rectangles. The meaning of the array of rectangles changes during the processing of the WM_NCCALCSIZE message.

.

    When the window procedure receives the WM_NCCALCSIZE message, the first rectangle contains the new coordinates of a window that has been moved or resized, that is, it is the proposed new window coordinates. The second contains the coordinates of the window before it was moved or resized. The third contains the coordinates of the window's client area before the window was moved or resized. If the window is a child window, the coordinates are relative to the client area of the parent window. If the window is a top-level window, the coordinates are relative to the screen origin.

.

    When the window procedure returns, the first rectangle contains the coordinates of the new client rectangle resulting from the move or resize. The second rectangle contains the valid destination rectangle, and the third rectangle contains the valid source rectangle. The last two rectangles are used in conjunction with the return value of the WM_NCCALCSIZE message to determine the area of the window to be preserved.

43: RECT
.
Summary
The RECT structure defines the coordinates of the upper-left and lower-right corners of a rectangle.
.

   public RECT(System.Drawing.Rectangle r) : this(r.Left, r.Top, r.Right, r.Bottom) { }

.

   public static implicit operator System.Drawing.Rectangle(RECT r)

.

     return new System.Drawing.Rectangle(r.Left, r.Top, r.Width, r.Height);

.

   public static implicit operator RECT(System.Drawing.Rectangle r)

.

     else if (obj is System.Drawing.Rectangle)

.

       return Equals(new RECT((System.Drawing.Rectangle)obj));

.

     return ((System.Drawing.Rectangle)this).GetHashCode();

.

    Public Sub New(ByVal Rectangle As Rectangle)

.

        Me.New(Rectangle.Left, Rectangle.Top, Rectangle.Right, Rectangle.Bottom)

.

    Public Shared Widening Operator CType(ByVal Rectangle As RECT) As Rectangle

.

        Return New Rectangle(Rectangle.Left, Rectangle.Top, Rectangle.Width, Rectangle.Height)

.

    Public Shared Widening Operator CType(ByVal Rectangle As Rectangle) As RECT

.

        Return New RECT(Rectangle.Left, Rectangle.Top, Rectangle.Right, Rectangle.Bottom)

.

    Public Shared Operator =(ByVal Rectangle1 As RECT, ByVal Rectangle2 As RECT) As Boolean

.

        Return Rectangle1.Equals(Rectangle2)

.

    Public Shared Operator <>(ByVal Rectangle1 As RECT, ByVal Rectangle2 As RECT) As Boolean

.

        Return Not Rectangle1.Equals(Rectangle2)

.

    Public Overloads Function Equals(ByVal Rectangle As RECT) As Boolean

.

        Return Rectangle.Left = _Left AndAlso Rectangle.Top = _Top AndAlso Rectangle.Right = _Right AndAlso Rectangle.Bottom = _Bottom

.

        ElseIf TypeOf [Object] Is Rectangle Then

.

        Return Equals(New RECT(DirectCast([Object], Rectangle)))

.

The Win32 RECT structure is not compatible with the .NET System.Drawing.Rectangle structure.

.

but the System.Drawing.Rectangle structure has left, top, width and height members internally.

.

   Public Function ToRectangle() As Rectangle

.

     Return Rectangle.FromLTRB(Left, Top, Right, Bottom)

.

     Return "Rect: " & ToRectangle.ToString

Enums

.

    /// Sets the clipping rectangle of the child window to that of the parent window so that the child can draw on the parent.

.

    ''' Sets the clipping rectangle of the child window to that of the parent window so that the child can draw on the parent.

.

    /// <summary>DCX_WINDOW: Returns a DC that corresponds to the window rectangle rather

.

    /// than the client rectangle.</summary>

.

    ''' <summary>DCX_WINDOW: Returns a DC that corresponds to the window rectangle rather

.

    ''' than the client rectangle.</summary>

.

    ///Invalid rectangle

.

    [Description("Invalid rectangle")]

.

    '''Invalid rectangle

.

    <Description("Invalid rectangle")> _

.

    /// Invalidates the rectangle or region that you specify in lprcUpdate or hrgnUpdate.

.

    /// Validates the rectangle or region that you specify in lprcUpdate or hrgnUpdate.

.

    ''' Invalidates the rectangle or region that you specify in lprcUpdate or hrgnUpdate.

.

    ''' Validates the rectangle or region that you specify in lprcUpdate or hrgnUpdate.

.

        /// The width of the rectangle around the location of a first click in a double-click sequence, in pixels. ,

.

        /// The second click must occur within the rectangle that is defined by SM_CXDOUBLECLK and SM_CYDOUBLECLK for the system

.

        /// To set the width of the double-click rectangle, call SystemParametersInfo with SPI_SETDOUBLECLKWIDTH.

.

        /// The width of the left and right edges of the focus rectangle that the DrawFocusRectdraws.

.

        /// The width of a grid cell for items in large icon view, in pixels. Each item fits into a rectangle of size

.

        /// The width of a grid cell for a minimized window, in pixels. Each minimized window fits into a rectangle this size when arranged.

.

        /// The width of the virtual screen, in pixels. The virtual screen is the bounding rectangle of all display monitors.

.

        /// The height of the rectangle around the location of a first click in a double-click sequence, in pixels.

.

        /// The second click must occur within the rectangle defined by SM_CXDOUBLECLK and SM_CYDOUBLECLK for the system to consider

.

        /// rectangle, call SystemParametersInfo with SPI_SETDOUBLECLKHEIGHT.

.

        /// The height of the top and bottom edges of the focus rectangle drawn byDrawFocusRect.

.

        /// The height of a grid cell for items in large icon view, in pixels. Each item fits into a rectangle of size

.

        /// The height of a grid cell for a minimized window, in pixels. Each minimized window fits into a rectangle this size when arranged.

.

        /// The height of the virtual screen, in pixels. The virtual screen is the bounding rectangle of all display monitors.

.

        /// The coordinates for the left side of the virtual screen. The virtual screen is the bounding rectangle of all display monitors.

.

        /// The coordinates for the top of the virtual screen. The virtual screen is the bounding rectangle of all display monitors.

.

    ''' Width of the rectangle around the location of a first click in a double-click sequence in pixels. The second click must occur within the rectangle defined by SM_CXDOUBLECLK and SM_CYDOUBLECLK for the system to consider the two clicks a double-click

.

    ''' Height of the rectangle around the location of a first click in a double-click sequence in pixels. The second click must occur within the rectangle defined by SM_CXDOUBLECLK and SM_CYDOUBLECLK for the system to consider the two clicks a double-click. (The two clicks must also occur within a specified time.)

.

    ''' Width of a grid cell for items in large icon view in pixels. Each item fits into a rectangle of size SM_CXICONSPACING by SM_CYICONSPACING when arranged. This value is always greater than or equal to SM_CXICON

.

    ''' Height of a grid cell for items in large icon view in pixels. Each item fits into a rectangle of size SM_CXICONSPACING by SM_CYICONSPACING when arranged. This value is always greater than or equal to SM_CYICON.

.

    ''' Width of a grid cell for a minimized window in pixels. Each minimized window fits into a rectangle this size when arranged. This value is always greater than or equal to SM_CXMINIMIZED.

.

    ''' Height of a grid cell for a minimized window in pixels. Each minimized window fits into a rectangle this size when arranged. This value is always greater than or equal to SM_CYMINIMIZED.

.

    ''' Width of a rectangle centered on a drag point to allow for limited movement of the mouse pointer before a drag operation begins in pixels.

.

    ''' Height of a rectangle centered on a drag point to allow for limited movement of the mouse pointer before a drag operation begins. This value is in pixels. It allows the user to click and release the mouse button easily without unintentionally starting a drag operation.

.

    ''' Windows XP (v5.1+) Width of the left and right edges of the focus rectangle drawn by DrawFocusRect. This value is in pixels.

.

    ''' Windows XP (v5.1+) Height of the top and bottom edges of the focus rectangle drawn by DrawFocusRect. This value is in pixels.

.
Summary
Used by BitBlt to define how the color data for the source rectangle is to be combined with the color data for the destination rectangle to achieve the final color.
.

///     source rectangle is to be combined with the color data for the destination

.

///     rectangle to achieve the final color.

.

'''     source rectangle is to be combined with the color data for the destination

.

'''     rectangle to achieve the final color.

.

    /// The WM_SIZING message is sent to a window that the user is resizing. By processing this message, an application can monitor the size and position of the drag rectangle and, if needed, change its size or position.

.

    /// The WM_MOVING message is sent to a window that the user is moving. By processing this message, an application can monitor the position of the drag rectangle and, if needed, change its position.

.

    /// A window is being minimized or maximized. The system needs the coordinates of the minimized rectangle for the window.

.

    '''The WM_MOVING message is sent to a window that the user is moving. By processing this message an application can monitor the position of the drag rectangle and if needed change its position.

.

    '''The WM_SIZING message is sent to a window that the user is resizing. By processing this message an application can monitor the size and position of the drag rectangle and if needed change its size or position.

.

    ''' By processing this message, an application can monitor the size and position of the drag rectangle

.

    ''' A pointer to a <see cref="Win32.Types.Rect"/> structure with the screen coordinates of the drag rectangle.

.

    ''' To change the size or position of the drag rectangle, an application must change the members of this structure.

.

    ''' By processing this message an application can monitor the position of the drag rectangle and

kernel32

.

       [In] ref SMALL_RECT lpScrollRectangle,

.

        IntPtr lpClipRectangle,

.

        const uint CONSOLE_SELECTION_NOT_EMPTY = 0x0002; //Selection rectangle is not empty

.

        const uint CONSOLE_SELECTION_NOT_EMPTY = 0x0002; //Selection rectangle is not empty

.

  Dim rect As Rectangle = New Rectangle(0, 0, Width, Height)

comctl32

.

       public static void Draw(this ImageList imageList, Graphics g, Rectangle bounds, int index, ImageListDrawColor bgColor, ImageListDrawColor fgColor, NativeMethods.ImageListDrawingStyle style = NativeMethods.ImageListDrawingStyle.Normal, int overlayImageIndex = 0)

.

       public static void Draw(this ImageList imageList, Graphics g, Rectangle bounds, int index, ImageListDrawColor bgColor, ImageListDrawColor fgColor, NativeMethods.ImageListDrawingStyle style = NativeMethods.ImageListDrawingStyle.Normal, int overlayImageIndex = 0)

msvcrt

57: memcpy
.

        new Rectangle(0, 0, width, height),

.

        new Rectangle(0, 0, width, height),

gdi32

58: BitBlt
.

The BitBlt function performs a bit-block transfer of the color data corresponding to a rectangle of pixels from the specified source device context into a destination device context.

.

///    rectangle of pixels from the specified source device context into

.

/// <param name="nXDest">The leftmost x-coordinate of the destination rectangle (in pixels).</param>

.

/// <param name="nYDest">The topmost y-coordinate of the destination rectangle (in pixels).</param>

.

/// <param name="nWidth">The width of the source and destination rectangles (in pixels).</param>

.

/// <param name="nHeight">The height of the source and the destination rectangles (in pixels).</param>

.

/// <param name="nXSrc">The leftmost x-coordinate of the source rectangle (in pixels).</param>

.

/// <param name="nYSrc">The topmost y-coordinate of the source rectangle (in pixels).</param>

.

'''    rectangle of pixels from the specified source device context into

.

''' <param name="nXDest">The leftmost x-coordinate of the destination rectangle (in pixels).</param>

.

''' <param name="nYDest">The topmost y-coordinate of the destination rectangle (in pixels).</param>

.

''' <param name="nWidth">The width of the source and destination rectangles (in pixels).</param>

.

''' <param name="nHeight">The height of the source and the destination rectangles (in pixels).</param>

.

''' <param name="nXSrc">The leftmost x-coordinate of the source rectangle (in pixels).</param>

.

''' <param name="nYSrc">The topmost y-coordinate of the source rectangle (in pixels).</param>

.

If a rotation or shear transformation is in effect in the source device context, BitBlt returns an error. If other transformations exist in the source device context (and a matching transformation is not in effect in the destination device context), the rectangle in the destination device context is stretched, compressed, or rotated, as necessary.

.

drawingArea.FillRectangle(lGB, drawingArea.VisibleClipBounds)

.

    vGraphics.DrawRectangle(Pens.Blue, new Rectangle(0, 0, 300, 300));

.

    vGraphics.DrawRectangle(Pens.Blue, new Rectangle(50, 70, 300, 300));

Cut off search results after 60. Please refine your search.


 
Access PInvoke.net directly from VS: