资源简介
使用C#编写winform的仿真飞行仪表盘,可实现俯仰角,滚动角,航向角的可视化监测

代码片段和文件信息
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Dashboard
{
public partial class Form1 : Form
{
public Image imgtmp;
public Image imgori;
public Bitmap bitmp;
public Bitmap bm;
public bool IsSure = false;
double DbPitchAngle = new double(); //俯仰角度[-9090]
double DbRowAngle = new double(); //滚转角度[-180180]
double DbYawAngle = new double(); //航向角度[-4545]
public Form1()
{
InitializeComponent();
}
//重绘旋转后的仪表盘图片
public void Overlap(Bitmap btm int x int y int w int h)
{
Bitmap image = new Bitmap(btm);
Bitmap hi = new Bitmap(bm);
Graphics g = Graphics.FromImage(hi);
g.DrawImage(image new Rectangle(x y w h));
bm = hi;
}
//-------------------磁罗盘显示函数-------------------//
//入口参数:
//航向角 dir_angle 范围0~360 度
private void Compass_Disp(double dir_angle)
{
string file = System.IO.Path.Combine(Environment.CurrentDirectory @“point.jpg“);
bitmp = new Bitmap(file);
Bitmap pointImage = new Bitmap(250 250);
System.Drawing.Graphics gPoint = System.Drawing.Graphics.FromImage(pointImage);
gPoint.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.Bilinear;
gPoint.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
//计算偏移量
Rectangle rectPoint = new Rectangle(0 0 250 250);
gPoint.TranslateTransform(125 125);
//g.RotateTransform(360 - row_angle);
gPoint.RotateTransform((float)dir_angle);
//恢复图像在水平和垂直方向的平移
gPoint.TranslateTransform(-125 -125);
gPoint.DrawImage(bitmp rectPoint);
//重至绘图的所有变换
gPoint.ResetTransform();
gPoint.Dispose();
//保存旋转后的图片
bm = pointImage;
Overlap(pointImage 0 0 250 250);
CompointBox.Image = bm;
// 刻度盘截圆
System.Drawing.Drawing2D.GraphicsPath gp = new System.Drawing.Drawing2D.GraphicsPath();
gp.FillMode = 0;
gp.AddEllipse(new Rectangle(0 0 350 350));
ComshellBox.Region = new Region(gp);
//表盘截圆
System.Drawing.Drawing2D.GraphicsPath gp1 = new System.Drawing.Drawing2D.GraphicsPath();
gp1.FillMode = 0;
gp1.AddEllipse(new Rectangle(0 0 250 250));
CompointBox.Region = new Region(gp1);
gp1.Dispose();
gp.Dispose();
gPoint.Dispose();
bitmp.Dispose();
//Graphics gp1 = CompointBox.CreateGraphics();
//gp
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 36801 2018-08-25 16:49 仪表盘\Dashboard\Dashboard\11.jpg
文件 36801 2018-08-25 16:49 仪表盘\Dashboard\Dashboard\bin\Debug\11.jpg
文件 24939 2018-08-24 20:49 仪表盘\Dashboard\Dashboard\bin\Debug\compass.jpg
文件 89600 2018-12-26 11:43 仪表盘\Dashboard\Dashboard\bin\Debug\Dashboard.exe
文件 28160 2018-12-26 11:43 仪表盘\Dashboard\Dashboard\bin\Debug\Dashboard.pdb
文件 11600 2018-12-26 11:43 仪表盘\Dashboard\Dashboard\bin\Debug\Dashboard.vshost.exe
文件 490 2012-06-06 02:06 仪表盘\Dashboard\Dashboard\bin\Debug\Dashboard.vshost.exe.manifest
文件 13901 2018-08-24 20:50 仪表盘\Dashboard\Dashboard\bin\Debug\point.jpg
文件 24939 2018-08-24 20:49 仪表盘\Dashboard\Dashboard\compass.jpg
文件 3908 2018-12-26 11:29 仪表盘\Dashboard\Dashboard\Dashboard.csproj
文件 9711 2018-12-26 11:44 仪表盘\Dashboard\Dashboard\Form1.cs
文件 5138 2018-12-26 11:44 仪表盘\Dashboard\Dashboard\Form1.Designer.cs
文件 6011 2018-12-26 11:44 仪表盘\Dashboard\Dashboard\Form1.resx
文件 526 2018-12-26 11:43 仪表盘\Dashboard\Dashboard\obj\x86\Debug\Dashboard.csproj.FileListAbsolute.txt
文件 1061 2018-12-26 11:41 仪表盘\Dashboard\Dashboard\obj\x86\Debug\Dashboard.csproj.GenerateResource.Cache
文件 89600 2018-12-26 11:43 仪表盘\Dashboard\Dashboard\obj\x86\Debug\Dashboard.exe
文件 180 2018-12-26 11:41 仪表盘\Dashboard\Dashboard\obj\x86\Debug\Dashboard.Form1.resources
文件 28160 2018-12-26 11:43 仪表盘\Dashboard\Dashboard\obj\x86\Debug\Dashboard.pdb
文件 76481 2018-12-26 11:42 仪表盘\Dashboard\Dashboard\obj\x86\Debug\Dashboard.Properties.Resources.resources
文件 2867 2018-12-26 11:06 仪表盘\Dashboard\Dashboard\obj\x86\Debug\DesignTimeResolveAssemblyReferences.cache
文件 6460 2018-12-26 11:43 仪表盘\Dashboard\Dashboard\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache
文件 5120 2018-12-26 11:12 仪表盘\Dashboard\Dashboard\obj\x86\Debug\TempPE\Properties.Resources.Designer.cs.dll
文件 13901 2018-08-24 20:50 仪表盘\Dashboard\Dashboard\point.jpg
文件 490 2018-12-26 11:06 仪表盘\Dashboard\Dashboard\Program.cs
文件 36801 2018-08-25 16:49 仪表盘\Dashboard\Dashboard\Properties\11.jpg
文件 1350 2018-12-26 11:06 仪表盘\Dashboard\Dashboard\Properties\AssemblyInfo.cs
文件 24939 2018-08-24 20:49 仪表盘\Dashboard\Dashboard\Properties\compass.jpg
文件 13901 2018-08-24 20:50 仪表盘\Dashboard\Dashboard\Properties\point.jpg
文件 3961 2018-12-26 11:12 仪表盘\Dashboard\Dashboard\Properties\Resources.Designer.cs
文件 6645 2018-12-26 11:12 仪表盘\Dashboard\Dashboard\Properties\Resources.resx
............此处省略17个文件信息
- 上一篇:C#动态添加数据到折线图
- 下一篇:winform自绘波形,鼠标滚轮滚动缩放波形尺寸
相关资源
- Winform可视化打印模板设计工具含源码
- c# winform 自动登录 百度账户 源代码
- DirectX.Capturec# winform 操作摄像头录像附
- C# 五子棋程序 附带编程日记
- C# winform实现表数据导出到Excel表格
- C# WinForm读写INI文件
- C#处理png图片位深度和交错属性
- winform(c#)最全73种非常漂亮界面样式
- winform与内嵌echarts的数据交互,让数据
- winform分页控件
- winform materialskin好看的皮肤组件
- winform 皮肤
- C#全套皮肤一共73款(IrisSkin4)
- UI界面皮肤(winform)
- winform开发的人脸识别打卡系统
- winform下拉多选自定义控件(带全选)
- winform控件库
- C# winform简洁漂亮的图形界面库SunnyU
- C# 斑马标签打印 (WEBamp;WINFORM)
- winform shell编程
- winform实时获取网卡网速全部源码,获
- winform实现饼状图、柱状图、折线图(
- winform简单用户登录(带验证码)
- 输入框自动切换中文(C#winform)vs20
- winform右下角弹窗
- windorm 加载WPF控件 ,实现dxf文件显示
- C# 俄罗斯方块(winform)
- C# 贪吃蛇(winform)
- C# 五子棋(winform源码)
- Winform中嵌入excel
评论
共有 条评论