| 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
)
Public Shared Function CreateTrackbar (
trackbarName As String,
winName As String,
ByRef value As Integer,
count As Integer,
Optional onChange As TrackbarCallbackNative = Nothing,
Optional userData As IntPtr = Nothing
) As Integer
public:
static int CreateTrackbar(
String^ trackbarName,
String^ winName,
int% value,
int count,
TrackbarCallbackNative^ onChange = nullptr,
IntPtr userData = nullptr
)
static member CreateTrackbar :
trackbarName : string *
winName : string *
value : int byref *
count : int *
?onChange : TrackbarCallbackNative *
?userData : IntPtr
(* Defaults:
let _onChange = defaultArg onChange null
let _userData = defaultArg userData null
*)
-> int
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