91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 50KB
    文件類型: .rar
    金幣: 2
    下載: 0 次
    發布日期: 2021-05-17
  • 語言: C#
  • 標簽: C#??示波器??

資源簡介

用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?簡單示波器
{
????public?partial?class?Form1?:?Form
????{
????????int?type?=?0;???//決定顯示的波型
????????double?range?=?10;?//顯示的波的振幅,初始值為10
????????double?periods?=?5;??//顯示的波的周期,初始值為10
????????public?Form1()
????????{
????????????InitializeComponent();

????????}

????????private?void?pictureBox1_Paint(object?sender?PaintEventArgs?e)
????????{
???????????
????????????Graphics?g?=?e.Graphics;
????????????Pen?mypen=new?Pen(Color.Black2);

????????????g.TranslateTransform(this.pictureBox1.Width?/?2.0f?this.pictureBox1.Height?/?2.0f);
????????????g.ScaleTransform(1?-1);//改變坐標

????????????g.DrawLine(mypen?-this.pictureBox1.Width?/?2.0f?0?this.pictureBox1.Width?/?2.0f?0);
????????????g.DrawLine(mypen?0?-this.pictureBox1.Height?/?2.0f?0?this.pictureBox1.Height?/?2.0f);
????????????//畫坐標
????????????g.DrawLine(mypen?-5.0f?this.pictureBox1.Height?/?2.0f?-?5.0f?0?this.pictureBox1.Height?/?2.0f);
????????????g.DrawLine(mypen?5.0f?this.pictureBox1.Height?/?2.0f?-?5.0f?0?this.pictureBox1.Height?/?2.0f);
????????????//畫Y方向上的箭頭
????????????g.DrawLine(mypen?this.pictureBox1.Width?/?2.0f?-?7.0f?5.0f?this.pictureBox1.Width?/?2.0f?-?3.0f?0);
????????????g.DrawLine(mypen?this.pictureBox1.Width?/?2.0f?-?7.0f?-5.0f?this.pictureBox1.Width?/?2.0f?-?3.0f?0);
????????????//畫X方向上的箭頭


????????????//下面代碼中的??251?是由this.pictureBox1.Width?/?2.0f取整數得來的。

????????????switch?(type)//根據type畫不同的波型
????????????{
????????????????case?0:???//畫正弦波
????????????????????double?x1?x2?y1?y2;
????????????????????for?(x1?=?-251;?x1?<=?251;?x1++)
????????????????????{
????????????????????????y1?=?Math.Sin(x1?/?periods)?*?range;
????????????????????????x2?=?x1?+?1;
????????????????????????y2?=?Math.Sin(x2?/?periods)?*?range;
????????????????????????g.DrawLine(mypen?(float)x1?(float)y1?(float)x2?(float)y2);
????????????????????}
????????????????????break;
????????????????case?1:???//畫方波
????????????????????double?x3?x4?y;
????????????????????for?(x3?=?-251;?x3?<=?251;?x3++)
????????????????????{
????????????????????????if?(Math.IEEERemainder(x3?periods)?>?0?&&?Math.IEEERemainder(x3?periods)?????????????????????????????y?=?range;
????????????????????????else
????????????????????????????y?=?-range;
????????????????????????x4?=?x3?+?1;
????????????????????????g.DrawLine(mypen?(float)x3?(float)y?(float)x4?(float)y);
????????????????????}
????????????????????break;
????????????????case?2:?//畫三角波
????????????????????double?x;
????????????????????for?(x?=?-251;?x?<=?251;?x?=?x?+?1)
????????????????????{
????????????????????????if?(Math.IEEERemainder(x?periods)?==?0)
????????????????????????{
????????????????????????????g.DrawLine(mypen?(float)x?0?(float)(x?+?periods?/?4)?(float)range)

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????文件??????13312??2012-06-22?10:47??簡單示波器\簡單示波器\bin\Debug\簡單示波器.exe

?????文件??????32256??2012-06-22?10:47??簡單示波器\簡單示波器\bin\Debug\簡單示波器.pdb

?????文件??????11600??2012-06-22?10:47??簡單示波器\簡單示波器\bin\Debug\簡單示波器.vshost.exe

?????文件????????490??2009-08-31?00:40??簡單示波器\簡單示波器\bin\Debug\簡單示波器.vshost.exe.manifest

?????文件???????4530??2012-06-22?10:51??簡單示波器\簡單示波器\Form1.cs

?????文件??????11138??2012-06-22?09:42??簡單示波器\簡單示波器\Form1.Designer.cs

?????文件???????5817??2012-06-22?09:42??簡單示波器\簡單示波器\Form1.resx

?????文件???????4440??2012-06-22?09:38??簡單示波器\簡單示波器\obj\x86\Debug\DesignTimeResolveAssemblyReferences.cache

?????文件???????6359??2012-06-22?10:47??簡單示波器\簡單示波器\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache

?????文件????????792??2012-06-22?10:45??簡單示波器\簡單示波器\obj\x86\Debug\GenerateResource.read.1.tlog

?????文件???????1858??2012-06-22?10:45??簡單示波器\簡單示波器\obj\x86\Debug\GenerateResource.write.1.tlog

?????文件???????7897??2012-06-22?09:42??簡單示波器\簡單示波器\obj\x86\Debug\ResolveAssemblyReference.cache

?????文件???????3180??2012-06-22?10:47??簡單示波器\簡單示波器\obj\x86\Debug\簡單示波器.csproj.FileListAbsolute.txt

?????文件??????13312??2012-06-22?10:47??簡單示波器\簡單示波器\obj\x86\Debug\簡單示波器.exe

?????文件????????180??2012-06-22?10:45??簡單示波器\簡單示波器\obj\x86\Debug\簡單示波器.Form1.resources

?????文件??????32256??2012-06-22?10:47??簡單示波器\簡單示波器\obj\x86\Debug\簡單示波器.pdb

?????文件????????180??2012-06-22?10:45??簡單示波器\簡單示波器\obj\x86\Debug\簡單示波器.Properties.Resources.resources

?????文件????????496??2012-06-21?10:35??簡單示波器\簡單示波器\Program.cs

?????文件???????1362??2012-06-21?10:35??簡單示波器\簡單示波器\Properties\AssemblyInfo.cs

?????文件???????2880??2012-06-21?10:35??簡單示波器\簡單示波器\Properties\Resources.Designer.cs

?????文件???????5612??2012-06-21?10:35??簡單示波器\簡單示波器\Properties\Resources.resx

?????文件???????1100??2012-06-21?10:35??簡單示波器\簡單示波器\Properties\Settings.Designer.cs

?????文件????????249??2012-06-21?10:35??簡單示波器\簡單示波器\Properties\Settings.settings

?????文件???????3689??2012-06-21?11:19??簡單示波器\簡單示波器\簡單示波器.csproj

?????文件????????887??2012-06-21?10:35??簡單示波器\簡單示波器.sln

????..A..H.?????23552??2012-06-22?10:51??簡單示波器\簡單示波器.suo

?????目錄??????????0??2012-06-21?10:35??簡單示波器\簡單示波器\obj\x86\Debug\TempPE

?????目錄??????????0??2012-06-22?10:47??簡單示波器\簡單示波器\obj\x86\Debug

?????目錄??????????0??2012-06-21?12:33??簡單示波器\簡單示波器\bin\Debug

?????目錄??????????0??2012-06-21?12:33??簡單示波器\簡單示波器\obj\x86

............此處省略8個文件信息

評論

共有 條評論