Added support for highgui module on WinRT 8.1+
Signed-off-by: Maxim Kostin <v-maxkos@microsoft.com>
This commit is contained in:
@@ -79,7 +79,7 @@ It provides easy interface to:
|
||||
attached to the control panel is a trackbar, or the control panel is empty, a new buttonbar is
|
||||
created. Then, a new button is attached to it.
|
||||
|
||||
See below the example used to generate the figure: :
|
||||
See below the example used to generate the figure:
|
||||
@code
|
||||
int main(int argc, char *argv[])
|
||||
int value = 50;
|
||||
@@ -122,6 +122,45 @@ It provides easy interface to:
|
||||
}
|
||||
@endcode
|
||||
|
||||
|
||||
@defgroup highgui_winrt WinRT support
|
||||
|
||||
This figure explains new functionality implemented with WinRT GUI. The new GUI provides an Image control,
|
||||
and a slider panel. Slider panel holds trackbars attached to it.
|
||||
|
||||
Sliders are attached below the image control. Every new slider is added below the previous one.
|
||||
|
||||
See below the example used to generate the figure:
|
||||
@code
|
||||
void sample_app::MainPage::ShowWindow()
|
||||
{
|
||||
static cv::String windowName("sample");
|
||||
cv::winrt_initContainer(this->cvContainer);
|
||||
cv::namedWindow(windowName); // not required
|
||||
|
||||
cv::Mat image = cv::imread("Assets/sample.jpg");
|
||||
cv::Mat converted = cv::Mat(image.rows, image.cols, CV_8UC4);
|
||||
cvtColor(image, converted, CV_BGR2BGRA);
|
||||
cv::imshow(windowName, converted); // this will create window if it hasn't been created before
|
||||
|
||||
int state = 42;
|
||||
cv::TrackbarCallback callback = [](int pos, void* userdata)
|
||||
{
|
||||
if (pos == 0) {
|
||||
cv::destroyWindow(windowName);
|
||||
}
|
||||
};
|
||||
cv::TrackbarCallback callbackTwin = [](int pos, void* userdata)
|
||||
{
|
||||
if (pos >= 70) {
|
||||
cv::destroyAllWindows();
|
||||
}
|
||||
};
|
||||
cv::createTrackbar("Sample trackbar", windowName, &state, 100, callback);
|
||||
cv::createTrackbar("Twin brother", windowName, &state, 100, callbackTwin);
|
||||
}
|
||||
@endcode
|
||||
|
||||
@defgroup highgui_c C API
|
||||
@}
|
||||
*/
|
||||
|
Reference in New Issue
Block a user