As Jonathan D has explained in his data, void*
is C’s way of denoting a generic type that isn’t directly usable. It’s C’s way of implementing a generic interface, and although it has a direct equivalent in C# (System.IntPtr
) you will probably want to use something else because C# has better ways of dealing with generic data, and it’s uncertain that you need to pass generic data here.
Since you’re passing image data to the function there are several possibilities what void*
would represent in C#:
byte[]
to pass the raw image data to the function
System.Drawing.Color[,]
if you are handling higher-level point data (unlikely)
System.Drawing.Image
if you want to handle the image data on a higher level; this is probably a good idea if you can get away with it
IntPtr
if you have a low-level buffer and the function internally passes the data to a C API without processing it itself.
Without more information on how you will use the code and what parts you are translating it’s impossible to tell which of these types you need here.