Colorramp object generation RIBBON

Source: Internet
Author: User

Private void button6_click (Object sender, eventargs E)
{
// Create a new algorithmiccolorrampclass object
Ialgorithmiccolorramp algcolorramp = new algorithmiccolorrampclass ();
// Create the starting color object
Irgbcolor startcolor = new rgbcolor ();
Startcolor. red= 255;
Startcolor. Green = 0;
Startcolor. Blue = 0;
// Create an end color object
Irgbcolor endcolor = new rgbcolor ();
Endcolor. Red = 0;
Endcolor. green= 255;
Endcolor. Blue = 0;
// Set the starting and ending color attributes of algorithmiccolorrampclass
Algcolorramp. tocolor = startcolor;
Algcolorramp. fromcolor = endcolor;
// Set the Gradient Type
Algcolorramp. algorithm = esricolorrampalgorithm. esricielabalgorithm;
// Set the color and color Quantity
Algcolorramp. size = 5;
// Create a color band
Bool bture = true;
Algcolorramp. createramp (Out bture );
// Use ienumcolors to obtain the color band
Ienumcolors penumcolors = NULL;
Penumcolors = algcolorramp. colors;
// Set the background color of five pictureboxes to the 5 colors that generate the color band.
This. picturebox1.backcolor = colortranslator. fromole (penumcolors. Next (). RGB );
This. picturebox2.backcolor = colortranslator. fromole (penumcolors. Next (). RGB );
This. picturebox3.backcolor = colortranslator. fromole (penumcolors. Next (). RGB );
This. picturebox4.backcolor = colortranslator. fromole (penumcolors. Next (). RGB );
This. picturebox5.backcolor = colortranslator. fromole (penumcolors. Next (). RGB );
}
From: http://bbs.esrichina-bj.cn/ESRI/thread-46784-1-1.html

 

 

Private void button6_click (Object sender, eventargs E)
{
Irandomcolorramp prandomcolorramp = new randomcolorrampclass ();

// ** Create a series of random colors between orange and blue-green
Prandomcolorramp. starthue = 40;
Prandomcolorramp. endhue = 120;
Prandomcolorramp. minvalue = 65;
Prandomcolorramp. maxvalue = 90;
Prandomcolorramp. minsaturation = 25;
Prandomcolorramp. maxsaturation = 45;
Prandomcolorramp. size = 20;
Prandomcolorramp. Seed = 23;

Bool bture = true;
Prandomcolorramp. createramp (Out bture );

Ienumcolors penumcolors = prandomcolorramp. colors;

// Set the background color of five pictureboxes to the 5 colors that generate the color band.
This. picturebox1.backcolor = colortranslator. fromole (penumcolors. Next (). RGB );
This. picturebox2.backcolor = colortranslator. fromole (penumcolors. Next (). RGB );
This. picturebox3.backcolor = colortranslator. fromole (penumcolors. Next (). RGB );
This. picturebox4.backcolor = colortranslator. fromole (penumcolors. Next (). RGB );
This. picturebox5.backcolor = colortranslator. fromole (penumcolors. Next (). RGB );
}

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.