1

I have a WinForms app (C#, .NET 4.7) that processes a video frame-by-frame in a background thread. There is a PictureBox control for preview which displays frames being processed in real-time.

This all works fine but I'd like to detect if the container form is visible on screen or occluded by other windows. Since previewing in the PictureBox is a performance bottleneck, I'd like to skip frame preview if and only if the form is not visible to the user.

Determining if the form is in focus is simple but not enough.

Is there a way to determine this in managed or un-managed code?

Raheel Khan
  • 14,205
  • 13
  • 80
  • 168
  • 2
    What have you tried? https://stackoverflow.com/questions/4747935/c-sharp-winform-check-if-control-is-physicaly-visible, https://stackoverflow.com/questions/6694267/how-can-i-detect-the-visibility-of-a-control – CodeCaster May 24 '17 at 12:46

0 Answers0