Skip to content

Fix control bitmap bounds with DWM enabled #319

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

Merged
merged 1 commit into from
Aug 5, 2025

Conversation

ynerant
Copy link
Contributor

@ynerant ynerant commented Jul 11, 2025

The PR #307 introduced a regression while creating a Bitmap object from a Control. This PR partially resolved #308, but only for a window control. When transforming an inner control into a Bitmap, the current code is computing pRect which is the bounding rectangle of the handle and add its coordinates to the requested rectangle's ones.

I had an issue because the bounding rectangle of my window start from (-8, -8) and goes to (1928, 1088), and all my screenshots were dephased from 8 pixels to the top and to the left. Replacing theses boundings with these given by DwmGetWindowExtendFrameBounds solves the issue, as in other parts of the file.

Signed-off-by: Emmy D'Anello <emmy.danello@sncf.fr>
@yinkaisheng yinkaisheng merged commit 2c0c65b into yinkaisheng:master Aug 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

A screenshot of the control captures the incorrect area.
2 participants