资源简介
c#绘制的飞控仪表盘,之前学习的时候网上下载的,同时分享给大家

代码片段和文件信息
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace AttitudeInstrument
{
public partial class AirSpeedIndicator : UserControl
{
public AirSpeedIndicator()
{
InitializeComponent();
}
protected override void OnPaintBackground(PaintEventArgs e)
{
//base.OnPaintBackground(e);
}
protected override void OnPaint(PaintEventArgs e)
{
if (e.ClipRectangle.Width == 0 || e.ClipRectangle.Height == 0)
return;
using (Bitmap bmp = new Bitmap((int)e.Graphics.VisibleClipBounds.Width (int)e.Graphics.VisibleClipBounds.Height))
{
Graphics g = Graphics.FromImage(bmp);
Pen whitePen = new Pen(Brushes.White 2.0f);
g.Clear(Color.FromArgb(57 49 66));
// 姿态仪的中心位置,即天地分割线的中点。
// 绘制俯仰角标尺时,每2.5°为15像素,因此俯仰角每变动1°,标尺应移动6像素,
// 故中心线也移动6像素
Point center = new Point((int)bmp.Width / 2 (int)(bmp.Height / 2 + _dblAirSpeed * 3));
// 可视的中心位置,即 LCD 的中心,该点在移动刻度时会用到
Point visibleCenter = new Point((int)bmp.Width / 2 (int)(bmp.Height / 2));
Font indicatorFont = new Font(“Time NewRoman“ 9);
double stringWidth = 0;
// 绘制空速表刻度线
for (int i = 0; i <= 500; i+=10)
{
g.DrawLine(whitePen (float)(bmp.Width - 10.0) (float)(bmp.Height/2 - 3.0 * i + _dblAirSpeed * 3) (float)(bmp.Width) (float)(bmp.Height/2 - 3.0 * i + _dblAirSpeed * 3));
stringWidth = g.MeasureString(i.ToString() indicatorFont).Width;
if (i % 20 == 0)
g.DrawString(i.ToString() indicatorFont Brushes.White (float)(bmp.Width - 10.0 - stringWidth) (float)(bmp.Height / 2 - 3.0 * i - 8 + _dblAirSpeed * 3));
}
Point[] indicator = new Point[8];
indicator[0] = new Point(bmp.Width - 45 visibleCenter.Y - 15);
indicator[1] = new Point(bmp.Width - 15 visibleCenter.Y - 15);
indicator[2] = new Point(bmp.Width - 15 visibleCenter.Y - 5);
indicator[3] = new Point(bmp.Width - 10 visibleCenter.Y);
indicator[4] = new Point(bmp.Width - 15 visibleCenter.Y + 5);
indicator[5] = new Point(bmp.Width - 15 visibleCenter.Y + 15);
indicator[6] = new Point(bmp.Width - 45 visibleCenter.Y + 15);
indicator[7] = new Point(bmp.Width - 45 visibleCenter.Y - 15);
g.FillPolygon(new SolidBrush(Color.FromArgb(16 16 49)) indicator);
g.DrawLines(whitePen indicator);
indicatorFont = new Fon
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 3694 2012-01-20 14:51 下载的飞控界面源码\AttitudeInstrument\AirSpeed\AirSpeed.cs
文件 1375 2012-01-20 12:01 下载的飞控界面源码\AttitudeInstrument\AirSpeed\AirSpeed.Designer.cs
文件 619 2012-01-20 14:31 下载的飞控界面源码\AttitudeInstrument\AirSpeed\AirSpeed.Properties.cs
文件 5814 2012-01-20 12:00 下载的飞控界面源码\AttitudeInstrument\AirSpeed\AirSpeed.resx
文件 329 2012-01-20 14:31 下载的飞控界面源码\AttitudeInstrument\AirSpeed\AirSpeed.Vars.cs
文件 3300 2012-01-20 15:00 下载的飞控界面源码\AttitudeInstrument\Altitude\Altitude.cs
文件 1367 2012-01-20 14:56 下载的飞控界面源码\AttitudeInstrument\Altitude\Altitude.Designer.cs
文件 620 2012-01-20 14:55 下载的飞控界面源码\AttitudeInstrument\Altitude\Altitude.Properties.cs
文件 5814 2012-01-20 14:24 下载的飞控界面源码\AttitudeInstrument\Altitude\Altitude.resx
文件 321 2012-01-20 14:56 下载的飞控界面源码\AttitudeInstrument\Altitude\Altitude.Vars.cs
文件 5243 2017-07-05 13:43 下载的飞控界面源码\AttitudeInstrument\AttitudeInstrument.csproj
文件 411 2012-01-20 15:27 下载的飞控界面源码\AttitudeInstrument\BasicFlightInfo\BasicFlightInfo.cs
文件 3668 2012-01-20 15:27 下载的飞控界面源码\AttitudeInstrument\BasicFlightInfo\BasicFlightInfo.Designer.cs
文件 1433 2012-01-20 15:07 下载的飞控界面源码\AttitudeInstrument\BasicFlightInfo\BasicFlightInfo.Properties.cs
文件 5814 2012-01-20 15:27 下载的飞控界面源码\AttitudeInstrument\BasicFlightInfo\BasicFlightInfo.resx
文件 15360 2017-07-05 13:43 下载的飞控界面源码\AttitudeInstrument\bin\Release\AttitudeInstrument.dll
文件 40448 2017-07-05 13:43 下载的飞控界面源码\AttitudeInstrument\bin\Release\AttitudeInstrument.pdb
文件 180 2017-07-05 13:43 下载的飞控界面源码\AttitudeInstrument\obj\Release\AttitudeInstrument.AirSpeedIndicator.resources
文件 180 2017-07-05 13:43 下载的飞控界面源码\AttitudeInstrument\obj\Release\AttitudeInstrument.AltitudeMeter.resources
文件 180 2017-07-05 13:43 下载的飞控界面源码\AttitudeInstrument\obj\Release\AttitudeInstrument.BasicFlightInfo.BasicFlightInfo.resources
文件 1063 2017-07-05 13:43 下载的飞控界面源码\AttitudeInstrument\obj\Release\AttitudeInstrument.csproj.FileListAbsolute.txt
文件 1018 2017-07-05 13:43 下载的飞控界面源码\AttitudeInstrument\obj\Release\AttitudeInstrument.csproj.GenerateResource.Cache
文件 15360 2017-07-05 13:43 下载的飞控界面源码\AttitudeInstrument\obj\Release\AttitudeInstrument.dll
文件 40448 2017-07-05 13:43 下载的飞控界面源码\AttitudeInstrument\obj\Release\AttitudeInstrument.pdb
文件 180 2017-07-05 13:43 下载的飞控界面源码\AttitudeInstrument\obj\Release\AttitudeInstrument.PitchAndBank.resources
文件 6235 2017-07-05 13:45 下载的飞控界面源码\AttitudeInstrument\obj\Release\DesignTimeResolveAssemblyReferences.cache
文件 6723 2017-07-05 13:43 下载的飞控界面源码\AttitudeInstrument\obj\Release\DesignTimeResolveAssemblyReferencesInput.cache
文件 12204 2012-01-20 15:16 下载的飞控界面源码\AttitudeInstrument\PitchAndBank\PitchAndBank.cs
文件 1388 2012-01-20 14:28 下载的飞控界面源码\AttitudeInstrument\PitchAndBank\PitchAndBank.Designer.cs
文件 933 2012-01-20 15:12 下载的飞控界面源码\AttitudeInstrument\PitchAndBank\PitchAndBank.Properties.cs
............此处省略105个文件信息
- 上一篇:js前台加密C#后台解密
- 下一篇:教务管理系统(c#.net源码)
相关资源
- C# TIP文件生成和拆解
- C#解析HL7消息的库135797
- C# OCR数字识别实例,采用TessnetOcr,对
- 考试管理系统 - C#源码
- asp.net C#购物车源代码
- C#实时网络流量监听源码
- C#百度地图源码
- Visual C#.2010从入门到精通配套源程序
- C# 软件版本更新
- C#屏幕软键盘源码,可以自己定制界面
- 智慧城市 智能家居 C# 源代码
- c#获取mobile手机的IMEI和IMSI
- C#实现简单QQ聊天程序
- 操作系统 模拟的 欢迎下载 C#版
- C#写的计算机性能监控程序
- 用C#实现邮件发送,有点类似于outlo
- MVC model层代码生成器 C#
- c#小型图书销售系统
- C# Socket Server Client 通讯应用 完整的服
- c# winform 自动登录 百度账户 源代码
- C#编写的16进制计算器
- C#TCP通信协议
- C# 数据表(Dataset)操作 合并 查询一
- C#语音识别系统speechsdk51,SpeechSDK51L
- 数据库备份还原工具1.0 C# 源码
-
[免费]xm
lDocument 节点遍历C# - EQ2008LEDc#开发实例
- DirectX.Capturec# winform 操作摄像头录像附
- c# 实现的最大最小距离方法对鸢尾花
- C#版保龄球记分代码
评论
共有 条评论