Hi,
we are planning to rewrite an extisting C++ image processing
application/library in C#. Now several question arouse where I hope you can
help me:
So far we allocated a block of memory as image buffer, handed this to a
driver dll and got raw image data back in this buffer. We then handed this
buffer by reference to another C++ dll to do base image processing on it.
Alternativly we copy an area of the whole image to a newly allocated
imagebuffer and then hand this over eitehr to this native dll or to an
client application that asks for an image buffer.
As in C++ handing an block of memory from one object to another due to
pointers is realy easy I do not know ho to do this in C#. We still will have
a native driver dll or at least a native COM component that captures images
into some buffer. For performance reasons we also will have some native C++
dll that does hard image processing. The control of the image capture and
tranfer of image data or part of it between capture and processing should be
handelt by C# objects. What is the best way to handle this.
Furthermore we have to offer an interface to Display the image buffers or to
provide a client application a handle to the image so that itself can
Display this images. How do I do this in C#. In our current solution we just
and a pointer to the Imagefuffer through C functions to the client so that
it can to a StretchDIBBits or to create a DirectDraw Surface for Displaying.
We would like to keep a possibility for the client apülication to visualize
Image Buffers or part of them by DirectDraw (fast scrolling ans Scaling) and
offer them also a possibilty to draw into this buffers to mark certain
areas. At this point we first make a copy of the imagebuffer to MemDC draw
into this and then use DirectDraw to get it to the Screen.
So please give a short primer how to handle image data in C#.
Best regards
Thomas