Skip to content

Off-by-ones in windows/GDI window calculations - #13451

Merged
opencv-pushbot merged 1 commit into
opencv:3.4from
crackwitz:gdi-off-by-one
Dec 26, 2018
Merged

opencv-pushbot merged 1 commit into
opencv:3.4from
crackwitz:gdi-off-by-one

Conversation

@crackwitz

Copy link
Copy Markdown
Contributor

This pullrequest changes

When looking closely, there's a gray "gutter" around the displayed image. Since it's just 1 pixel wide, it never showed up on the bottom and right borders between image and window chrome.

That gutter is now visible properly. Perhaps it would make sense to remove it entirely (set to zero in icvCalcWindowRect). Previously that would have cut off the last row and column of an image.

There has been no issue for this and it fixes no bugs (to my knowledge). This is purely cosmetic.

@crackwitz

Copy link
Copy Markdown
Contributor Author

In fact, I would recommend setting gutter to zero. When sending a window into WND_PROP_FULLSCREEN, the gray gutter is clearly visible and the image is rescaled accordingly. That means if I displayed an image equal to my screen resolution, it would still need to be resampled.

@mshabunin mshabunin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please rebase this PR to the 3.4 branch.

@crackwitz

Copy link
Copy Markdown
Contributor Author

I have no idea how to do this "properly". there is a lot of difference between master and 3.4. please bear with me.

Check for "gutter" around displayed image. there was one row/column missing on the bottom/right.
Might as well set gutter = 0?
@crackwitz crackwitz closed this Dec 25, 2018
@crackwitz
crackwitz deleted the gdi-off-by-one branch December 25, 2018 17:02
@crackwitz
crackwitz restored the gdi-off-by-one branch December 25, 2018 17:04
@crackwitz

Copy link
Copy Markdown
Contributor Author

if there's anything further I should do, please let me know. this level of working with git is still beyond me.

@crackwitz crackwitz reopened this Dec 25, 2018
@crackwitz
crackwitz changed the base branch from master to 3.4 December 25, 2018 17:13
@opencv-pushbot
opencv-pushbot merged commit beba82b into opencv:3.4 Dec 26, 2018
@crackwitz
crackwitz deleted the gdi-off-by-one branch December 27, 2018 00:43
@alalek alalek mentioned this pull request Dec 27, 2018
SavyaSanchi-Sharma pushed a commit to SavyaSanchi-Sharma/opencv that referenced this pull request Jul 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants