473,387 Members | 1,283 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How to handle image buffers in C#

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
Jan 11 '06 #1
2 14500
Check out Bob Powell's GDI+ FAQ:

http://www.bobpowell.net/gdiplus_faq.htm

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
You can lead a fish to a bicycle,
but it takes a very long time,
and the bicycle has to *want* to change.

<SH******@newsgroup.nospam> wrote in message
news:%2***************@TK2MSFTNGP12.phx.gbl...
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

Jan 11 '06 #2
Hi Thomas,
Welcome to MSDN Newsgroup!
please give a short primer how to handle image data in C#.

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/...essing_Lab.asp

Title: Image Processing for Dummies with C# and GDI
URL:http://www.codeproject.com/cs/media/...cfilters11.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

Jan 12 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Georg Andersson | last post by:
hi i'm using a liitle script to insert images in a mssql database. yes i know i'm not supposed to store images in a database, but after my images are only 3kb in size, i've decided to do it...
9
by: Pierre Tremblay | last post by:
Hi! I am trying to display an image in my html document. The document contains the following line: <td class="Input"><img...
8
by: iyuen | last post by:
I'm having problems with converting a byte array to an image object~ My byte array is an picture in VB6 StdPicture format. I've used propertybag to convert the picture into base64Array format in...
1
by: Doug Taylor | last post by:
I'm VERY new to C# and still a bit clumsy with COM. I'm tasked to use C# to design and create an object that can be called from VC6, VB6, and .NET applications (and possibly even from plain old...
0
by: Sam Durai | last post by:
Hello, A particular select query took unusually long time to execute hence I took an app.snap to find out what happens internally and I found out that tablequeue buffers are overflowing on a...
6
by: RaulAbHK | last post by:
Dear all, I guess this is a basic question with an easy answer but I am a beginner and I would much apreciate your feedbacks. Let's say I have a library with some functionality to perform some...
4
by: Muddasir | last post by:
Hi.. i am having a strange problem.......the problem is i am trying to upload a file and to store it in db....when the file got stored in db...it got converted into black and white image and...
2
by: =?Utf-8?B?RG9u?= | last post by:
Hello, I have a image of a building, I want to set the color of each room based on values that come back from a database. How would you do this. Is there a certain image control in asp.net? Or...
5
by: madhav001 | last post by:
Hi, I am biginner in C++ and I tried to combine two memory buffers of TIFF image data to one so that to save it as one image. ie: left half image + right half image = a full image. That was not...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.