• 大小: 220KB
    文件类型: .rar
    金币: 2
    下载: 1 次
    发布日期: 2021-06-12
  • 语言: C#
  • 标签: graphic  winfor  rad  

资源简介

使用c#语言简写的窗体应用程序生成雷达扇扫图并且有刻度标识鼠标移动显示当前的刻度和长度

资源截图

代码片段和文件信息

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 DrawRada
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        #region 画扇形图和2107等的数据
        PointF orignalPoint = new PointF();
        float rMax rMiddle rMin;
        struct pointlist
        {
            public float targetDis;
            public float targetAngle;
        }
        List targetList = new List();
        Random rd = new Random();
        Bitmap bitmap;
        private void Form1_Load(object sender EventArgs e)
        {
            pointlist item = new pointlist();
            for (int i = 0; i < 10; i++)
            {
                item.targetDis = rd.Next(0 12000);
                item.targetAngle = rd.Next(-45 45);
                targetList.Add(item);
            }
            bitmap = new Bitmap(pictureBox1.Width pictureBox1.Height);
        }
        public Bitmap ShowPolePicture(Bitmap bmpstring str)
        {
            Graphics g;
            g = Graphics.FromImage(bmp);
            g.Clear(Color.Black);
            g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
            //Color a=Color.FromArgb (rgb)
            //设置画笔
            Pen penframe = new Pen(Color.Yellow 2);
            Pen penframeCenter = new Pen(Color.Yellow 1);
            penframeCenter.Dashstyle = System.Drawing.Drawing2D.Dashstyle.Dash;
            Pen penLine = new Pen(Color.Green 2);
            Pen penPoint = new Pen(Color.White 1);
            Font ft = new Font(“Times New Roman“ 13);
            //设置圆心和半径
            //PointF orignalPoint = new PointF();            
            orignalPoint.X = pictureBox1.Location.X + (pictureBox1.Width) / 2.0f;
            orignalPoint.Y = pictureBox1.Location.Y + pictureBox1.Height - 35;
            rMax = pictureBox1.Height - 40;
            rMiddle = rMax * 2 / 3;
            rMin = rMax / 3;
            PointF P0 = new PointF();//扫描线的坐标
            PointF P1 = new PointF();//弧形中心点坐标
            PointF PL = new PointF();//左极限坐标
            PointF PR = new PointF();//右极限坐标
            PointF PLMax = new PointF();//左最大坐标
            PointF PRMax = new PointF();//右最大坐标
            PointF PLMiddle = new PointF();//左中间坐标
            PointF PRMiddle = new PointF();//右中间坐标
            PointF PLMin = new PointF();//左最下坐标
            PointF PRMin = new PointF();//右最下坐标
            P1.X = orignalPoint.X;
            P1.Y = orignalPoint.Y - rMax;
            //扫描线的坐标            
            P0.X = orignalPoint.X + (float)(rMax * Math.Cos(Math.PI / 180 * (Angle - 90)));
            P0.Y = orignalPoint.Y + (float)(rMax * Math.Sin(Math.PI / 180 * (Angle - 90)));
            g.DrawLine(penLine orignalPoint P0)

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件     150016  2018-07-05 16:47  DrawRada\DrawRada\bin\Debug\DrawRada.exe

     文件      28160  2018-07-05 16:47  DrawRada\DrawRada\bin\Debug\DrawRada.pdb

     文件      11600  2018-07-05 16:47  DrawRada\DrawRada\bin\Debug\DrawRada.vshost.exe

     文件        490  2018-04-12 07:35  DrawRada\DrawRada\bin\Debug\DrawRada.vshost.exe.manifest

     文件       3904  2018-07-05 16:47  DrawRada\DrawRada\DrawRada.csproj

     文件       9144  2018-07-05 16:47  DrawRada\DrawRada\Form1.cs

     文件       4327  2018-07-05 16:47  DrawRada\DrawRada\Form1.Designer.cs

     文件     107783  2018-07-05 16:47  DrawRada\DrawRada\Form1.resx

     文件       5420  2018-07-05 14:55  DrawRada\DrawRada\obj\x86\Debug\DesignTimeResolveAssemblyReferences.cache

     文件       6387  2018-07-05 16:47  DrawRada\DrawRada\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache

     文件        610  2018-07-05 16:47  DrawRada\DrawRada\obj\x86\Debug\DrawRada.csproj.FileListAbsolute.txt

     文件        975  2018-07-05 16:47  DrawRada\DrawRada\obj\x86\Debug\DrawRada.csproj.GenerateResource.Cache

     文件       9174  2018-07-05 14:58  DrawRada\DrawRada\obj\x86\Debug\DrawRada.csprojResolveAssemblyReference.cache

     文件     150016  2018-07-05 16:47  DrawRada\DrawRada\obj\x86\Debug\DrawRada.exe

     文件      68212  2018-07-05 16:47  DrawRada\DrawRada\obj\x86\Debug\DrawRada.Form1.resources

     文件      28160  2018-07-05 16:47  DrawRada\DrawRada\obj\x86\Debug\DrawRada.pdb

     文件        180  2018-07-05 16:47  DrawRada\DrawRada\obj\x86\Debug\DrawRada.Properties.Resources.resources

     文件        489  2018-07-04 15:10  DrawRada\DrawRada\Program.cs

     文件       1348  2018-07-04 15:10  DrawRada\DrawRada\Properties\AssemblyInfo.cs

     文件       2868  2018-07-04 15:10  DrawRada\DrawRada\Properties\Resources.Designer.cs

     文件       5612  2018-07-04 15:10  DrawRada\DrawRada\Properties\Resources.resx

     文件       1095  2018-07-04 15:10  DrawRada\DrawRada\Properties\Settings.Designer.cs

     文件        249  2018-07-04 15:10  DrawRada\DrawRada\Properties\Settings.settings

     文件      67646  2018-07-05 16:47  DrawRada\DrawRada\radar_wifi_wi-fi_128px_11538_easyicon.net.ico

     文件        866  2018-07-04 15:10  DrawRada\DrawRada.sln

    ..A..H.     20480  2018-07-05 16:47  DrawRada\DrawRada.suo

     目录          0  2018-07-04 15:10  DrawRada\DrawRada\obj\x86\Debug\TempPE

     目录          0  2018-07-05 16:47  DrawRada\DrawRada\obj\x86\Debug

     目录          0  2018-07-04 15:54  DrawRada\DrawRada\bin\Debug

     目录          0  2018-07-04 15:10  DrawRada\DrawRada\obj\x86

............此处省略8个文件信息

评论

共有 条评论