Fast reading of unmanaged buffers.
-
Hi all, I'm working in C# with a unmanged Dll that provides me a pointer to a byte buffer (768x576) that holds some video data. Is there any fast way to access the data and work e.g. with a bitmap object? Currently I'm converting the data by the help of: System.Runtime.InteropServices.Marshal.ReadByte But that is to slow for me. Any suggestions? Thanks, Snow.
-
Hi all, I'm working in C# with a unmanged Dll that provides me a pointer to a byte buffer (768x576) that holds some video data. Is there any fast way to access the data and work e.g. with a bitmap object? Currently I'm converting the data by the help of: System.Runtime.InteropServices.Marshal.ReadByte But that is to slow for me. Any suggestions? Thanks, Snow.
-
You can use pointers in unsafe code, like in this example: MSDN: How to save a .gif file with a new color table by using Visual C# .NET[^] --- b { font-weight: normal; }
Thanks for your hint. But I knew already that I can use pointers and I also used code simiar to the example. What I dont like in this solution is the "byte per byte" transfer to the new buffer. Isnt there a way to copy a complete block (like in C++ "memcpy" wich should be faster than a byte per byte transfer)? Thanks again Snow