infra 仪表盘效果
private void Gauge2()
{
// Infragistics.WebUI.UltraWebGauge.UltraGauge ultraGauge2 =
//new Infragistics.WebUI.UltraWebGauge.UltraGauge();
RadialGauge myRadialGauge = new RadialGauge();
RadialGaugeScale myScale = new RadialGaugeScale();
NumericAxis numericAxis1 = new NumericAxis();
RadialGaugeNeedle myNeedle = new RadialGaugeNeedle();
SolidFillBrushElement mySolidFillBrushElement = new SolidFillBrushElement();
SolidFillBrushElement mySolidFillBrushElementMajor =
new SolidFillBrushElement();
SolidFillBrushElement mySolidFillBrushElementMinor =
new SolidFillBrushElement();
SolidFillBrushElement mySolidFillBrushElementMinorStroke =
new SolidFillBrushElement();
StrokeElement myStrokeElement = new StrokeElement();
SolidFillBrushElement mySolidFillBrushElement2 = new SolidFillBrushElement();
SimpleGradientBrushElement mySimpleGradientBrushElement =
new SimpleGradientBrushElement();
SolidFillBrushElement mySolidFillBrushElement1 = new SolidFillBrushElement();
mySolidFillBrushElement.Color = System.Drawing.Color.Black;
myRadialGauge.Dial.BrushElement = mySolidFillBrushElement;
myRadialGauge.Margin = new Margin(10, 10, 10, 10, Measure.Pixels);
//Set the following Axis properties and add the Axis to your scale:
numericAxis1.EndValue = 120; //仪盘表最大数值
myScale.Axes.Add(numericAxis1);
//Set the following Scale properties
myScale.EndAngle = 405;
myScale.StartAngle = 135;
mySolidFillBrushElement1.Color = System.Drawing.Color.White;
myScale.Labels.BrushElement = mySolidFillBrushElement1;
//Set the following Label properties
myScale.Labels.Extent = 65;
myScale.Labels.Font =
new System.Drawing.Font("Arial", 14F,
System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Pixel);
myScale.Labels.Frequency = 20;//大间隔显示数值:0 20 40 60
myScale.Labels.Orientation =
Infragistics.UltraGauge.Resources.RadialLabelOrientation.Horizontal;
myScale.Labels.SpanMaximum = 18;
//Set the following major Tickmark properties:
mySolidFillBrushElementMajor.Color =
System.Drawing.Color.FromArgb(((int)(((byte)(189)))), ((int)(((byte)(189)))),
((int)(((byte)(189)))));
myScale.MajorTickmarks.BrushElement = mySolidFillBrushElementMajor;
myScale.MajorTickmarks.EndExtent = 95;
myScale.MajorTickmarks.EndWidth = 3;
myScale.MajorTickmarks.Frequency = 10; //大间隔显示频率
myScale.MajorTickmarks.StartExtent = 85;
myScale.MajorTickmarks.StartWidth = 3;
//Set the following minor Tickmark properties:
mySolidFillBrushElementMinor.Color =
System.Drawing.Color.FromArgb(((int)(((byte)(240)))), ((int)(((byte)(240)))),
((int)(((byte)(240)))));
myScale.MinorTickmarks.BrushElement = mySolidFillBrushElementMinor;
myScale.MinorTickmarks.EndExtent = 90;
myScale.MinorTickmarks.EndWidth = 1;
myScale.MinorTickmarks.Frequency = 2;
//小间隔频率=myScale.MajorTickmarks.Frequency/myScale.MinorTickmarks.Frequency=10/2=5
myScale.MinorTickmarks.StartExtent = 85;
mySolidFillBrushElementMinorStroke.Color =
System.Drawing.Color.FromArgb(((int)(((byte)(135)))), ((int)(((byte)(135)))),
((int)(((byte)(135)))));
myStrokeElement.BrushElement = mySolidFillBrushElementMinorStroke;
myScale.MinorTickmarks.StrokeElement = myStrokeElement;
//Set the following Anchor properties:
myNeedle.Anchor.BrushElement = mySimpleGradientBrushElement;
mySimpleGradientBrushElement.EndColor = System.Drawing.Color.WhiteSmoke;
mySimpleGradientBrushElement.GradientStyle =
Infragistics.UltraGauge.Resources.Gradient.BackwardDiagonal;
mySimpleGradientBrushElement.StartColor = System.Drawing.Color.Gray;
myNeedle.Anchor.RadiusMeasure =
Infragistics.UltraGauge.Resources.Measure.Percent;
//设置指针属性
mySolidFillBrushElement2.Color = System.Drawing.Color.Red;
myNeedle.BrushElement = mySolidFillBrushElement2;
myNeedle.EndExtent = 65;
myNeedle.EndWidth = 1;
myNeedle.MidExtent = 0;
myNeedle.MidWidth = 3;
myNeedle.Precision = 1;
myNeedle.StartExtent = -20;
myNeedle.StartWidth = 3;
myNeedle.Value = int.Parse(TextBox2.Text.Trim());//指针显示值
myNeedle.WidthMeasure = Measure.Percent;
myScale.Markers.Add(myNeedle);
myRadialGauge.Scales.Add(myScale);
UltraGauge2.Gauges.Add(myRadialGauge);
//图形的大小
UltraGauge2.Height = Unit.Pixel(200);
UltraGauge2.Width = Unit.Pixel(200);
//显示文本框
BoxAnnotation boxAnnotation1 = new BoxAnnotation();
SolidFillBrushElement solidFillBrushElement1 = new SolidFillBrushElement();
SolidFillBrushElement solidFillBrushElement2 = new SolidFillBrushElement();
boxAnnotation1.Bounds = new System.Drawing.Rectangle(38, 70, 25, 10);
boxAnnotation1.BoundsMeasure = Infragistics.UltraGauge.Resources.Measure.Percent;
solidFillBrushElement2.Color = System.Drawing.Color.White;
boxAnnotation1.Label.BrushElement = solidFillBrushElement2;
boxAnnotation1.Label.FormatString = "Speed";
this.UltraGauge2.Annotations.Add(boxAnnotation1);
this.Controls.Add(UltraGauge2);
---------------------
作者:厦门德仔
来源:CSDN
原文:https://blog.csdn.net/david_520042/article/details/7394188
版权声明:本文为博主原创文章,转载请附上博文链接!
infra 仪表盘效果的更多相关文章
- iOS仿支付宝芝麻信用仪表盘效果
概述 自定义View之高仿支付宝芝麻信用分数仪表盘动画效果 详细 代码下载:http://www.demodashi.com/demo/10654.html 仿支付宝芝麻信用仪表盘效果 一.主要思路 ...
- 基于canvas的仪表盘效果
概述 基于Canvas实现的仪表盘及效果.通过配置参数,可以任意修改仪表盘颜色,刻度,动画过渡时间等,满足不同场景下的使用.同时使用原生的Canvas,也是学习Canvas的很好的例子. 详细 代码下 ...
- canvas/CSS实现仪表盘效果
手机上看比较虚 <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <t ...
- canvas/CSS仪表盘效果
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...
- Dynamics CRM 2011 仪表盘(dashbord)中加入公告(announcement)模块
具体步骤如下: 1.将一下代码黏贴入一个取名叫"announcementsondashboard.htm"的html文件中,当然文件名你随便起无所谓. <span style ...
- WPF - 简单的UI框架 - 仪表盘
源码链接:https://github.com/DuelWithSelf/WPFEffects 参考:https://www.cnblogs.com/duel/p/duel_clock.html 更新 ...
- Android 开源库和项目 2
1.带尾巴的RecyclerViewPager 特点:1.像viewPager一样滑动一次就滑动一页 2.像画廊gallery一样,滑动一次可以滑动很多页 3.竖向滑动 4.支持点击事件,没有错乱 ...
- 秀才提笔忘了字:javascript使用requestAnimationFrame实现动画
requestAnimationFrame优于setTimeout/setInterval的地方在于它是由浏览器专门为动画提供的API,在运行时浏览器会自动优化方法的调用,并且如果页面不是激活状态下的 ...
- 转--2014年最新810多套android源码2.46GB免费一次性打包下载
转载自:http://www.eoeandroid.com/thread-497046-1-1.html 感谢该博客主人无私奉献~~ 下面的源码是从今年3月份开始不断整理源码区和其他网站上的安卓例子源 ...
随机推荐
- Linux root用户下不能打开Google-chrome的解决办法
在root下打开chrome会出现no sandbox的错误 解决方案: 1.找到google-chrome文件 在目录/opt/google/chrome 下 2.使用gedit打开该文件 最后一行 ...
- 静默文件安装安装WebLogic
一. 本文演示静默文件方式安装 •在Windows上 –打开命令行窗口 –filename.exe -mode=silent -silent_xml=file_path •在 ...
- docker简单操作
下载镜像docker pull httpd(镜像名) 查看镜像:docker images 做容器 docker run -ti -v(映射)/www:发布目录的路径 -p 80:80 --name ...
- STM8S003F3通过PWM波实现三基色呼吸灯(转)
源: STM8S003F3通过PWM波实现三基色呼吸灯
- MySQL Crash Course #13# Chapter 21. Creating and Manipulating Tables
之前 manipulate 表里的数据,现在则是 manipulate 表本身. INDEX 创建多列构成的主键 自动增长的规定 查看上一次插入的自增 id 尽量用默认值替代 NULL 外键不可以跨引 ...
- c++ sleep(windows/linux)
c标准中包含了一个sleep用以实现当前线程暂停执行n毫秒,如下所示: 函数名: sleep 功 能: 执行挂起一段时间 用 法: unsigned sleep(unsigned seconds); ...
- AJAX 与 Python 后台通信
Ajax 简介 Ajax 即“Asynchronous Javascript And XML”(异步 JavaScript 和 XML),是指一种创建交互式网页应用的网页开发技术. Ajax = 异步 ...
- 20165310 Java实验四 《Android程序设计》
20165310 实验四 <Android程序设计> 第24章:初识Android 任务一:改写res目录中的内容,Hello World后要显示自己的学号,自己学号前后一名同学的学号 首 ...
- 如何高效判断java数组是否包含某个值
在java中,我们如何判断一个未排序数组中是否包含一个特定的值?这在java中是一个频繁非常实用的操作.那么什么样的方法才是最高效的方式?当然 ,这个问题在Stack Overflow也是得票率非常高 ...
- CF 316E3 Summer Homework(斐波那契矩阵+线段树)
题目链接:http://codeforces.com/problemset/problem/316/E3 题意:一个数列A三种操作:(1)1 x y将x位置的数字修改为y:(2)2 x y求[x,y] ...