Search Results for

    Show / Hide Table of Contents

    Class NamedWindow

    Represents a window which can be used as placeholder for images and trackbars.

    Inheritance
    Object
    NamedWindow
    Namespace: OpenCV.Net
    Assembly: OpenCV.Net.dll
    Syntax
    public sealed class NamedWindow : IDisposable

    Constructors

    | Improve this Doc View Source

    NamedWindow(IntPtr)

    Initializes a new instance of the NamedWindow class from the specified native window handle.

    Declaration
    public NamedWindow(IntPtr handle)
    Parameters
    Type Name Description
    IntPtr handle

    The platform specific native window handle used to retrieve the window name.

    | Improve this Doc View Source

    NamedWindow(String, WindowFlags)

    Initializes a new instance of the NamedWindow class with the specified name.

    Declaration
    public NamedWindow(string name, WindowFlags flags = default(WindowFlags))
    Parameters
    Type Name Description
    String name

    The name of the window in the window caption.

    WindowFlags flags

    The flags of the window.

    Properties

    | Improve this Doc View Source

    Handle

    Gets the platform specific native window handle.

    Declaration
    public IntPtr Handle { get; }
    Property Value
    Type Description
    IntPtr
    | Improve this Doc View Source

    Name

    Gets the name of the window.

    Declaration
    public string Name { get; }
    Property Value
    Type Description
    String

    Methods

    | Improve this Doc View Source

    CreateTrackbar(String, ref Int32, Int32, TrackbarCallback)

    Creates a trackbar and attaches it to the window.

    Declaration
    public void CreateTrackbar(string trackbarName, ref int value, int count, TrackbarCallback onChanged = null)
    Parameters
    Type Name Description
    String trackbarName

    Name of the created trackbar.

    Int32 value

    A reference to an integer value that specifies the position of the slider.

    Int32 count

    Maximal position of the slider. Minimal position is always 0.

    TrackbarCallback onChanged

    The callback method that will be called every time the slider changes position.

    | Improve this Doc View Source

    DestroyAllWindows()

    Destroys all of the HighGUI windows.

    Declaration
    public static void DestroyAllWindows()
    | Improve this Doc View Source

    DisplayOverlay(String, Int32)

    Displays text on the window’s image as an overlay for delayMs milliseconds. This is not editing the image’s data. The text is displayed on the top of the image.

    Declaration
    public void DisplayOverlay(string text, int delayMs = 0)
    Parameters
    Type Name Description
    String text

    Overlay text to write on the window’s image.

    Int32 delayMs

    Delay to display the overlay text. If this method is called before the previous overlay text times out, the timer is restarted and the text updated. If this value is zero, the text never disappears.

    | Improve this Doc View Source

    DisplayStatusBar(String, Int32)

    Displays text on the window’s status bar for delayMs milliseconds.

    Declaration
    public void DisplayStatusBar(string text, int delayMs = 0)
    Parameters
    Type Name Description
    String text

    Text to write on the window’s status bar.

    Int32 delayMs

    Delay to display the text. If this method is called before the previous text times out, the timer is restarted and the text updated. If this value is zero, the text never disappears.

    | Improve this Doc View Source

    Dispose()

    Releases all resources used by the NamedWindow.

    Declaration
    public void Dispose()
    | Improve this Doc View Source

    Finalize()

    Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.

    Declaration
    protected void Finalize()
    | Improve this Doc View Source

    GetProperty(WindowProperty)

    Gets the parameters of the window.

    Declaration
    public WindowFlags GetProperty(WindowProperty propId)
    Parameters
    Type Name Description
    WindowProperty propId

    The identifier of the property to retrieve.

    Returns
    Type Description
    WindowFlags

    The value of the window property.

    | Improve this Doc View Source

    GetTrackbarPos(String)

    Returns the trackbar position.

    Declaration
    public int GetTrackbarPos(string trackbarName)
    Parameters
    Type Name Description
    String trackbarName

    The name of the trackbar.

    Returns
    Type Description
    Int32

    The current position of the specified trackbar.

    | Improve this Doc View Source

    LoadWindowParameters()

    Loads parameters of the window such as size, location, flags, etc.

    Declaration
    public void LoadWindowParameters()
    | Improve this Doc View Source

    Move(Int32, Int32)

    Sets the position of the window.

    Declaration
    public void Move(int x, int y)
    Parameters
    Type Name Description
    Int32 x

    The new x-coordinate of the top-left corner.

    Int32 y

    The new y-coordinate of the top-left corner.

    | Improve this Doc View Source

    Resize(Int32, Int32)

    Sets the window size.

    Declaration
    public void Resize(int width, int height)
    Parameters
    Type Name Description
    Int32 width

    The new width.

    Int32 height

    The new height.

    | Improve this Doc View Source

    SaveWindowParameters()

    Saves parameters of the window such as size, location, flags, etc.

    Declaration
    public void SaveWindowParameters()
    | Improve this Doc View Source

    SetMouseCallback(MouseCallback)

    Assigns a callback for mouse events.

    Declaration
    public void SetMouseCallback(MouseCallback onMouse)
    Parameters
    Type Name Description
    MouseCallback onMouse

    The callback method that will handle mouse events of this named window.

    | Improve this Doc View Source

    SetOpenGLContext()

    Makes the GL context current. Used only for windows with OpenGL support.

    Declaration
    public void SetOpenGLContext()
    | Improve this Doc View Source

    SetOpenGLDrawCallback(OpenGLDrawCallback)

    Assigns a callback to draw OpenGL on top of the image display. Used only for windows with OpenGL support.

    Declaration
    public void SetOpenGLDrawCallback(OpenGLDrawCallback callback)
    Parameters
    Type Name Description
    OpenGLDrawCallback callback

    The callback method that will be called every frame.

    | Improve this Doc View Source

    SetProperty(WindowProperty, WindowFlags)

    Change the parameters of the window dynamically.

    Declaration
    public void SetProperty(WindowProperty propId, WindowFlags propValue)
    Parameters
    Type Name Description
    WindowProperty propId

    The identifier of the property to edit.

    WindowFlags propValue

    The new value of the window property.

    | Improve this Doc View Source

    SetTrackbarPos(String, Int32)

    Sets the trackbar position.

    Declaration
    public void SetTrackbarPos(string trackbarName, int pos)
    Parameters
    Type Name Description
    String trackbarName

    The name of the trackbar.

    Int32 pos

    The new trackbar position.

    | Improve this Doc View Source

    ShowImage(Arr)

    Displays the image in the specified window.

    Declaration
    public void ShowImage(Arr image)
    Parameters
    Type Name Description
    Arr image

    The image to be shown.

    | Improve this Doc View Source

    Update()

    Updates the window. Used only for windows with OpenGL support.

    Declaration
    public void Update()
    • Improve this Doc
    • View Source
    In This Article
    Back to top Generated by DocFX