cvui icon indicating copy to clipboard operation
cvui copied to clipboard

EnhancedWindow draws image outside of window

Open mwindowshz opened this issue 4 years ago • 3 comments

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.

mwindowshz avatar Jul 01 '20 16:07 mwindowshz

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

Dovyski avatar Jul 13 '20 20:07 Dovyski

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.

mwindowshz avatar Aug 15 '20 20:08 mwindowshz

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.

Dovyski avatar Aug 21 '20 10:08 Dovyski