Refract icon indicating copy to clipboard operation
Refract copied to clipboard

Focus on Window

Open jbienz opened this issue 4 years ago • 4 comments

Is your feature request related to a problem? Please describe. Feature request

Describe the solution you'd like It'd be great if Refract should be targeted at a specific window rather than the entire desktop. This would make it easier to do things like depth editing in PhotoShop.

Describe alternatives you've considered Currently Photoshop has to be maximized.

Additional context N/A

jbienz avatar Jan 10 '22 19:01 jbienz

The shortest path to supporting this would probably be to add support for uWindowCapture in addition to the currently supported uDesktopDuplication. This article (translation required) says that this will be slower than uDesktopDuplication, but if the target window is a lot smaller than the desktop it could be decent.

jbienz avatar Jan 11 '22 03:01 jbienz

This article (translation required) says that this will be slower than uDesktopDuplication, but if the target window is a lot smaller than the desktop it could be decent.

This article was written when uWindowCapture was released. It is old information. uWindowCapture now supports WinRT Windows.Graphics.Capture API. It works very fast. See this article for details.

AJpon avatar Jan 31 '22 09:01 AJpon

WinRT Windows.Graphics.Capture API is not supported on legacy Windows. (Windows 10 1803 or later is required) Currently, the only advantage of using uDesktopDuplication is that it works on legacy Windows. If you want to maintain compatibility, I recommend using uDesktopDuplication as is. However, i suggest you switch libraries if the reason you choose uDesktopDuplication is that it is faster than uWindowCapture.

AJpon avatar Jan 31 '22 09:01 AJpon

There are several libraries for Unity that support WinRT Windows.Graphics.Capture API. uWindowCapture also supports some legacy capture APIs, so it is highly compatible, but it is larger. If you don't care about compatibility, you can consider using a tiny library such as UnityGraphicsCapture.

AJpon avatar Jan 31 '22 10:01 AJpon