mirror of
https://github.com/DarthAffe/ScreenCapture.NET.git
synced 2025-12-12 13:28:35 +00:00
Added UpdateCaptureZone to readme
This commit is contained in:
parent
2a4dbd8fe5
commit
8aed47d42f
13
README.md
13
README.md
@ -17,7 +17,7 @@ IEnumerable<Display> displays = screenCaptureService.GetDisplays(graphicsCards.F
|
||||
// Create a screen-capture for all screens you want to capture
|
||||
IScreenCapture screenCapture = screenCaptureService.GetScreenCapture(displays.First());
|
||||
|
||||
// Register the regions you want to capture om the screen
|
||||
// Register the regions you want to capture on the screen
|
||||
// Capture the whole screen
|
||||
CaptureZone fullscreen = screenCapture.RegisterCaptureZone(0, 0, screenCapture.Display.Width, screenCapture.Display.Height);
|
||||
// Capture a 100x100 region at the top left and scale it down to 50x50
|
||||
@ -54,4 +54,13 @@ lock (fullscreen.Buffer)
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
// Move the top left zone more towards the center
|
||||
// Using the Update-method allows to move the zone without having to allocate
|
||||
// new buffers and textures which yields a good performance gain if done at high framerates.
|
||||
screenCapture.UpdateCaptureZone(topLeft, x: 100, y: 200);
|
||||
|
||||
// Note that resizing the zone is also possible but currently reinitializes the zone
|
||||
// -> no performance gain compared to removing and readding the zone.
|
||||
screenCapture.UpdateCaptureZone(topLeft, width: 20, height: 20);
|
||||
```
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user