Skip to content

Commit 8aed47d

Browse files
authored
Added UpdateCaptureZone to readme
1 parent 2a4dbd8 commit 8aed47d

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

README.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ IEnumerable<Display> displays = screenCaptureService.GetDisplays(graphicsCards.F
1717
// Create a screen-capture for all screens you want to capture
1818
IScreenCapture screenCapture = screenCaptureService.GetScreenCapture(displays.First());
1919

20-
// Register the regions you want to capture om the screen
20+
// Register the regions you want to capture on the screen
2121
// Capture the whole screen
2222
CaptureZone fullscreen = screenCapture.RegisterCaptureZone(0, 0, screenCapture.Display.Width, screenCapture.Display.Height);
2323
// Capture a 100x100 region at the top left and scale it down to 50x50
@@ -54,4 +54,13 @@ lock (fullscreen.Buffer)
5454
}
5555
}
5656
}
57-
```
57+
58+
// Move the top left zone more towards the center
59+
// Using the Update-method allows to move the zone without having to allocate
60+
// new buffers and textures which yields a good performance gain if done at high framerates.
61+
screenCapture.UpdateCaptureZone(topLeft, x: 100, y: 200);
62+
63+
// Note that resizing the zone is also possible but currently reinitializes the zone
64+
// -> no performance gain compared to removing and readding the zone.
65+
screenCapture.UpdateCaptureZone(topLeft, width: 20, height: 20);
66+
```

0 commit comments

Comments
 (0)