Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI
This Document is not yet Rated  Rate this Document

How to I Merge an Overlay in C#?

Primary Software: Driver Software>>Vision Acquisition Software
Primary Software Version: 8.5
Primary Software Fixed Version: N/A
Secondary Software: N/A

Problem:
I know how to create an overlay to an image within my C# project, but how to I merge that overlay to the image?

Solution:
Attached below is an example of using the merge overlay function within a C# project.  The line that performs the actual overlay has the following syntax:

CWIMAQViewer.Image.Overlays.Item(1).Merge(System.Type.Missing);

The item that is most often missed is System.Type.Missing and will cause an error if omitted.  To run the attached example, open the project included in the ZIP file and copy the attached image, Current.png, to your C drive.  When run, the program will create a new file called Current1.png that will have a rectangle overlayed on it.

Related Links:

KnowledgeBase 3FBELMKZ: Do NI-IMAQ and NI Vision Support Microsoft Visual Studio .NET?
Developer Zone Example: Snap and Grab with NI-IMAQ for IEEE 1394 Cameras in C#



Attachments:

current.png
MergeOverlay.zip






Report Date: 08/15/2008
Last Updated: 08/29/2008
Document ID: 4OEAM5DT

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit