Example Code

Gradient Color Ramp (Scrolling) using Labview

产品和环境

本部分要求填写创建该范例所需的产品和操作系统。

如要下载NI软件(包括以下所示产品),请访问ni.com/downloads

    软件

  • LabVIEW

代码和文档

添加附件

Overview

These VI demonstrate algorithms to generate color tables for LabVIEW color ramps.

 

Description
Use this Vi to create some color ramp. By using the rotate 1D array you could create some awesome gradient scrolling action. 

In the first step the application creates colors shades and then creates movement by an array rotation .

 

Requirements

  • LabVIEW 2012 (or compatible)

 
Steps to Implement or Execute Code

1. Open Scrolling Gradient Color Ramp LV2012 NI Verified

2. Set colors in color array
3. Run VI
4. Change speed
5. Try another colors combination

 

Additional Information or References

Top level VI Block Diagram

Scrolling Gradient Color Ramp LV2012 NI verified.png


 **This document has been updated to meet the current required format for the NI Code Exchange.** 

 

NI社区“代码范例交流区”(Example Code Exchange)中的代码范例已获得MIT许可

评论
josborne
Active Participant
Active Participant
修改时间

Thanks!  Great code.  Just used it to add some fancy effects to my GUI.

Kudos!

http://www.medicollector.com
David_L
Active Participant
Active Participant
修改时间

Awesome! I'm glad someone found it useful!

Hooovahh
Proven Zealot Proven Zealot
Proven Zealot
修改时间

Very neat thanks for sharing.  I had a need to generate a 2D picture with a gradient, so I took your output of an array of color boxes, and used the Draw Multiple Lines function, to draw a horizontal line for each color.  There was some room for improvement, using the newer concatenating tunnel function, and removing the build array in Create Gradient Array.vi and just use the normal indexing tunnel.

David_L
Active Participant
Active Participant
修改时间

Brian Hoover wrote:


There was some room for improvement.


                   

Considering that I was a 1-year LabVIEW user when I posted this, I'm sure there is quite a lot of room for improvement :-).  Either way, I'm glad it was useful. 

Hooovahh
Proven Zealot Proven Zealot
Proven Zealot
修改时间

1 year or not, you accomplished what I was looking for with pretty minimal effort.  I didn't have to write the code, I just did a search and this was the first complete result I found.  That being said I did develop my own using .Net and a gradient brush but I like the G solution in this case.

TScholtens
Member
Member
修改时间

I was looking for a way to color multiple lines in my XY graph in a gradient manner and found your tool very helpful, thanks!