0

I am trying to capture screen using ScreenCapture.NET in my C# project. However, I keep getting an error "Object reference not set to an instance of an object" at the following call:

_screenCapture.RegisterCaptureZone(0, 0, Dev.capture.width, Dev.capture.height);

enter image description here System.NullReferenceException

Message=Object reference not set to an instance of an object. Source=SharpGen.Runtime Arborescence des appels de procédure : à SharpGen.Runtime.CppObject.get_Item(Int32 index) à Vortice.Direct3D11.ID3D11Device.CreateTexture2D(Texture2DDescription desc, Void* initialData) à Vortice.Direct3D11.ID3D11Device.CreateTexture2D(Texture2DDescription description, SubresourceData[] initialData) à ScreenCapture.NET.DX11ScreenCapture.InitializeCaptureZone(CaptureZone& captureZone) à ScreenCapture.NET.DX11ScreenCapture.RegisterCaptureZone(Int32 x, Int32 y, Int32 width, Int32 height, Int32 downscaleLevel)

  • Does not look like the obvious things are null here (Like `_screenCapture` or `Dev`) since you have a stack of the internals that has been called. But this seems to be a seldomly used package that you might not finding anyone knowing of here. You might rather won't to ask the original author or if that does not help take the available source and try to debug it yourself. – Ralf May 08 '23 at 13:23

0 Answers0