1

I have written a screen capture program using windows screen capture API in DXGI。It works just OK。 But on some cases (such as when I drag a window to move it), the result contains a cursor shape on it.

like this]

This is not what I expected. Does ayone know how can I do to get rid of that.

Roman R.
  • 68,205
  • 6
  • 94
  • 158
wangcd
  • 21
  • 1
  • Welcome to SO! I think you could improve your chances of getting an answer with a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) – DCTID Mar 04 '20 at 04:19
  • @wangcd Hey, I have the same problem, did you end up figuring it out? – Nicholas Pipitone May 12 '20 at 20:04

1 Answers1

1

As far as i know there is no way to prevent this within DXGI. Your graphics adapter will decide wether to draw the cursor seperatly (you have to do the drawing yourself) or directly in to the screen image.

So basically your options are:

  • Write your own graphics adapter
  • Check if the cursor is invisible with FrameInfo->PointerPosition.Visible (that means the cursor is already drawn in the frame) and replace the cursor region with a previously saved frame -> overdraw it
  • Select a fully transparent cursor
CptLoops
  • 11
  • 2