| Cv2CreateTrackbar Method (String, String, 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,
int count,
TrackbarCallbackNative onChange = null,
IntPtr userData = null
)
Public Shared Function CreateTrackbar (
trackbarName As String,
winName As String,
count As Integer,
Optional onChange As TrackbarCallbackNative = Nothing,
Optional userData As IntPtr = Nothing
) As Integer
public:
static int CreateTrackbar(
String^ trackbarName,
String^ winName,
int count,
TrackbarCallbackNative^ onChange = nullptr,
IntPtr userData = nullptr
)
static member CreateTrackbar :
trackbarName : string *
winName : string *
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. - 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,OpenCvSharp.TrackbarCallbackNative,System.IntPtr)"]
See Also