Skip to content

Commit

Permalink
improve highgui
Browse files Browse the repository at this point in the history
  • Loading branch information
rainyl committed Mar 1, 2024
1 parent 648e371 commit cb9c7cb
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/dart_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
dart run opencv_dart:setup -p linux -a x64
- name: Run tests
run: flutter test
run: flutter test -x skip-workflow

test_windows:
runs-on: windows-latest
Expand Down
5 changes: 5 additions & 0 deletions lib/src/highgui/highgui.dart
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,11 @@ class Trackbar {
int max;
}

/// destroy all windows.
void destroyAllWindows() {
_bindings.destroyAllWindows();
}

enum WindowFlag {
/// the user can resize the window (no constraint) / also use to switch a fullscreen window to a normal size.
WINDOW_NORMAL(0x00000000),
Expand Down
6 changes: 4 additions & 2 deletions test/highgui_test.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@Tags(['skip-workflow'])
import 'package:test/test.dart';

import 'package:opencv_dart/opencv_dart.dart' as cv;
Expand All @@ -14,7 +15,8 @@ void main() async {
expect(win.isOpen, true);

win.setWindowProperty(cv.WindowPropertyFlags.WND_PROP_FULLSCREEN, cv.WindowFlag.WINDOW_FULLSCREEN.value);
expect(win.getWindowProperty(cv.WindowPropertyFlags.WND_PROP_FULLSCREEN), cv.WindowFlag.WINDOW_FULLSCREEN.value);
expect(win.getWindowProperty(cv.WindowPropertyFlags.WND_PROP_FULLSCREEN),
cv.WindowFlag.WINDOW_FULLSCREEN.value);
win.moveWindow(100, 100);
win.resizeWindow(100, 100);

Expand Down Expand Up @@ -56,7 +58,7 @@ void main() async {
trackbar.maxPos = 15;

// win.waitKey(1000);

win.close();
});
}

0 comments on commit cb9c7cb

Please sign in to comment.