Example Code

Create .NET Color Reference from a LabVIEW VI

Overview

----------

While using GMap.net I was required to supply a .NET color reference to change the color of a routing feature. However, I could not easily find a How-to tip on how to do this via on-line resources.

Description

------------

After some research on .net classes I found a way to accomplish this, and here I show how to provide

such a color reference from inside a LabVIEW VI.

Steps to Implement or Execute Code

-------------------------------------

- Create a .NET constructor and initialize the Windows: "System.Drawing.Color" Object reference.

- Drop a LabVIEW color picker and branch that into RGB color components.

- From the .net color reference, choose the METHOD: "From Argb" and wire-into this METHOD node

  the three color components from your LabVIEW color box.


The following block diagram image shows how you can achieve this:


Creat .NET Color Ref from LabVIEW.png

In the above block diagram: Both RED, and LVColor are valid .NET color reference terminals.

Requirements

-----------------

o Any version of LabVIEW Software that supports Windows .NET

o NOTE: The attached VI is in LabVIEW Ver 14.00

Anthony Lukindo



Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Contributors