Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EnhancedWindow draws image outside of window #95

Open
mwindowshz opened this issue Jul 1, 2020 · 3 comments
Open

EnhancedWindow draws image outside of window #95

mwindowshz opened this issue Jul 1, 2020 · 3 comments
Labels
bug c++ Issues related to the C++ version of cvui python Issues related to the Python version of cvui

Comments

@mwindowshz
Copy link

EnhancedWindow draws image outside of window

When trying to draw an image in EnhancedWindow
using

EnhancedWindow settings(0, 100, video.cols, video.rows, "video");
settings.begin(frame);
		if (!settings.isMinimized()) 
                {
			cvui::image(video); // video is mat with image
		}
		settings.end();

Image is displayed with some offset to the left and bottom and not in the "window" area:

image

hope there is a solution
Thanks
M.

@Dovyski Dovyski added bug c++ Issues related to the C++ version of cvui python Issues related to the Python version of cvui labels Jul 13, 2020
@Dovyski
Copy link
Owner

Dovyski commented Jul 13, 2020

Thanks for your bug report! It's probably the border of the hidden window being rendered. I'll check it.

@mwindowshz
Copy link
Author

Hi
I found a solution for this:
EnahncedWindow.h
line 74
I removed this line
//cvui::beginRow(frame, mX + std::lround(10*mFontScale/cvui::DEFAULT_FONT_SCALE), mY + std::lround(30*mFontScale/cvui::DEFAULT_FONT_SCALE), mWidth - scaledTitleHeight, mHeight - scaledTitleHeight);
whithout this the image is in place

image

Hope this is a good solution.

@Dovyski
Copy link
Owner

Dovyski commented Aug 21, 2020

Great, thank you. As soon as your PR is merged, the problem should be gone. If anyone is facing the issue, check the code snippet above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug c++ Issues related to the C++ version of cvui python Issues related to the Python version of cvui
Projects
None yet
Development

No branches or pull requests

2 participants