How to handle image buffers in C#

G

Guest

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
 
T

TerryFei

Hi Thomas,
Welcome to MSDN Newsgroup!
If you want to handle image in C#, you could refer to the following
articles,
Title: Image Processing Lab in C#
URL: http://www.codeproject.com/cs/media/Image_Processing_Lab.asp

Title: Image Processing for Dummies with C# and GDI
URL:http://www.codeproject.com/cs/media/csharpgraphicfilters11.asp

I hope the above information is helpful for you. If you have any questions,
please feel free to let me know. Thanks for your understanding!

Best Regards,

Terry Fei [MSFT]
Microsoft Community Support
Get Secure! www.microsoft.com/security
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top