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

Strange border #150

Open
Sean-Zeo opened this issue Apr 11, 2023 · 18 comments
Open

Strange border #150

Sean-Zeo opened this issue Apr 11, 2023 · 18 comments

Comments

@Sean-Zeo
Copy link

Hi, when capturing a window frame on windows 10 there appears to be a small black border along the left and top of the image;
image

@smasherprog
Copy link
Owner

Ill check this out later today and get back with you.

@Sean-Zeo
Copy link
Author

Ill check this out later today and get back with you.

Hi friend, any update?

@smasherprog
Copy link
Owner

I cannot reproduce this problem. Can you try out the Example CPP project and run that code with these lines NOT commented out

auto r = realcounter.fetch_add(1);

Then take a look at the output. See if you can reproduce it using the example code. You can comment out the other part of the test code, but run the code there and see if it still recurrs.

@Sean-Zeo
Copy link
Author

Sean-Zeo commented Apr 15, 2023

Hi, here is the result;
0WINNEW_
image

The black border still occurs.

I've also noticed if there are certain characters in the window name, it causes this error;
ArgumentException: Illegal byte sequence encounted in the input.
I believe it's due to this character;
image

-Sean

@Sean-Zeo
Copy link
Author

Seems to be an offset of the buffer bytes of raw rgb?

@Sean-Zeo
Copy link
Author

image
Temporary fix of the "illegal byte sequence" error is to only allow letters, numbers, spaces & special characters.

@smasherprog
Copy link
Owner

this fixes the issue?

@Sean-Zeo
Copy link
Author

Sean-Zeo commented Apr 17, 2023

this fixes the issue?

No, this only fixes the "illegal byte" crash when converting the w.Name to a string via; [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)] if it has special symbols.

This is unrelated to the border issue found when grabbing window frames.

@Sean-Zeo
Copy link
Author

Hi, I noticed when using GetWindowRect(IntPtr hWnd, out RECT lpRect); the lpRect position is -8 x -8 when a window is maximized, could this be related?

@smasherprog
Copy link
Owner

Since i cant reproduce the problem i cant really help much unfortunately. :(

@smasherprog
Copy link
Owner

I can take a look at that illegal character issue. Looks like your visiting github issues page while capturing a window. I can check that out.

@Sean-Zeo
Copy link
Author

Since i cant reproduce the problem i cant really help much unfortunately. :(

Hi why can't you reproduce? Do you not have access to a windows 10 machine?
-Sean

@smasherprog
Copy link
Owner

I have windows 10 and windows 11 and it doesnt occur on either machines capturing a window. There is no black border around it :(

@smasherprog
Copy link
Owner

smasherprog commented Apr 18, 2023

Its going to be something different on your machine than mine, so once that difference is identified we can fix it. Theres always little things that cause issues like this, but finding them is very hard. I have to rely on reporters to find the difference so it can be fixed in most cases.

@Sean-Zeo
Copy link
Author

Hi, just testing on a virtual machine, vps && a different laptop, the issue still occurs?
Can you show an example of it running correctly? The only window that seems to work without a border is task manager.
Thanks!

@smasherprog
Copy link
Owner

You have put alot of effort into this and i appreciate it. I am heading into work not but when i get home from work ill get back at it and try some things out.

@smasherprog
Copy link
Owner

I did do some testing yesterday and found some issues with border calculations. I havent fixed it yet, but i did find an area of code that is not correct. Still working on it right now

@smasherprog
Copy link
Owner

This is super anooooying.. Its in

inline WindowDimensions GetWindowRect(HWND hwnd) {

Ive been messing with it, but havent been able to fix it. TAG ur it!

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

No branches or pull requests

2 participants