Click or drag to resize

Cv2CreateTrackbar Method (String, String, Int32, Int32, TrackbarCallbackNative, IntPtr)

Creates a trackbar and attaches it to the specified window. The function createTrackbar creates a trackbar(a slider or range control) with the specified name and range, assigns a variable value to be a position synchronized with the trackbar and specifies the callback function onChange to be called on the trackbar position change.The created trackbar is displayed in the specified window winName.

Namespace:  OpenCvSharp
Assembly:  OpenCvSharp (in OpenCvSharp.dll) Version: 1.0.0
Syntax
public static int CreateTrackbar(
	string trackbarName,
	string winName,
	ref int value,
	int count,
	TrackbarCallbackNative onChange = null,
	IntPtr userData = null
)

Parameters

trackbarName
Type: SystemString
Name of the created trackbar.
winName
Type: SystemString
Name of the window that will be used as a parent of the created trackbar.
value
Type: SystemInt32
Optional pointer to an integer variable whose value reflects the position of the slider.Upon creation, the slider position is defined by this variable.
count
Type: SystemInt32
Maximal position of the slider. The minimal position is always 0.
onChange (Optional)
Type: OpenCvSharpTrackbarCallbackNative
Pointer to the function to be called every time the slider changes position. This function should be prototyped as void Foo(int, void\*); , where the first parameter is the trackbar position and the second parameter is the user data(see the next parameter). If the callback is the NULL pointer, no callbacks are called, but only value is updated.
userData (Optional)
Type: SystemIntPtr
User data that is passed as is to the callback. It can be used to handle trackbar events without using global variables.

Return Value

Type: Int32

[Missing <returns> documentation for "M:OpenCvSharp.Cv2.CreateTrackbar(System.String,System.String,System.Int32@,System.Int32,OpenCvSharp.TrackbarCallbackNative,System.IntPtr)"]

See Also