• 大小: 429KB
    文件类型: .rar
    金币: 2
    下载: 1 次
    发布日期: 2021-07-06
  • 语言: C#
  • 标签: .NET  

资源简介

此资源能实现对wav格式歌曲的波形进行绘制并能播放,利用scrollWindows的图像平移技术使得CPU占用率很低。

资源截图

代码片段和文件信息

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;

using System.Threading;

namespace test
{
    public partial class Form1 : Form
    {

        audioPro.map map1 = null;               //申明一个画板

        string wavWorkPath = “G:\\FireSys_Cb\\Programs_pc\\wavPro\\wavWork\\“;

        public Form1()
        {
            InitializeComponent();

            InitMap();

            map1.deScaleChange+=new audioPro.map.deScaleEventHandler(map1_deScaleChange);
        }

        private void map1_deScaleChange(int x)
        {
            this.textBox1.Text = x.ToString();
        }

        public void InitMap()
        {
            audioPro.mapDescription mapDescription1 = new audioPro.mapDescription();

            mapDescription1.backColor = Color.White;

            mapDescription1.foreColor = Color.MidnightBlue;

            mapDescription1.markFillColor = Color.Yellow;

            mapDescription1.nonWorkColor = Color.DarkGray;

            mapDescription1.markHeight = 15;

            mapDescription1.tscaleHeight = 20;

            mapDescription1.wavHeight = 200;

            mapDescription1.Adiv = 200;         //首先除以200

            mapDescription1.offsetY = Convert.ToInt16( 100 + mapDescription1.markHeight);

            map1 = new audioPro.map(mapDescription1);

            map1.Location = new System.Drawing.Point(50 0);

            map1.Width = this.Width - 60;

            map1.Anchor = ( Anchorstyles.Right | Anchorstyles.Left | Anchorstyles.Top );

            map1.Parent = this;

            this.map1.MouseMove+=new MouseEventHandler(map1_MouseMove);

        }

        private void map1_MouseMove(object sender MouseEventArgs e)
        {
            this.textBox2.Text = e.X.ToString() + “  “ + e.Y.ToString();
        }

        private void button5_Click(object sender EventArgs e)
        {
            string strtmp;

            strtmp = System.IO.Directory.GetCurrentDirectory();

            OpenFileDialog openFileDialog = new OpenFileDialog();

            openFileDialog.InitialDirectory = “H:\\娱乐\\音乐“;

            openFileDialog.Filter = “wav音频文件|*.wav“;

            openFileDialog.RestoreDirectory = true;

            openFileDialog.FilterIndex = 1;

            if (openFileDialog.ShowDialog() == DialogResult.OK)
            {
                string sourcePath=openFileDialog.FileName;

                string targetPath = wavWorkPath + sourcePath.Remove(0 sourcePath.LastIndexOf(‘\\‘) + 1);

                map1.initWav(targetPath sourcePath true);
                
            }
        }

        private void Form1_MouseDown(object sender MouseEventArgs e)
        {

        }

        private void button2_Click(object sender EventArgs e)
        {
            map1.play();
        

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

     文件      29696  2009-12-16 18:41  test\test\bin\Debug\audioPro.dll

     文件      48640  2009-12-16 18:41  test\test\bin\Debug\audioPro.pdb

     文件     196608  2009-11-23 17:02  test\test\bin\Debug\AxInterop.Microsoft.Vbe.Interop.Forms.dll

     文件      61440  2009-12-15 15:31  test\test\bin\Debug\AxInterop.WMPLib.dll

     文件     331776  2009-12-15 15:31  test\test\bin\Debug\Interop.WMPLib.dll

     文件      11264  2009-12-16 18:41  test\test\bin\Debug\test.exe

     文件      30208  2009-12-16 18:41  test\test\bin\Debug\test.pdb

     文件      14328  2009-12-17 11:38  test\test\bin\Debug\test.vshost.exe

     文件        490  2007-07-21 01:33  test\test\bin\Debug\test.vshost.exe.manifest

     目录          0  2009-12-08 17:18  test\test\bin\Debug

     目录          0  2009-12-08 17:18  test\test\bin

     文件       3285  2009-12-14 13:41  test\test\Form1.cs

     文件       6917  2009-12-14 13:41  test\test\Form1.Designer.cs

     文件       5814  2009-12-14 13:41  test\test\Form1.resx

     文件     196608  2009-11-23 17:02  test\test\obj\Debug\AxInterop.Microsoft.Vbe.Interop.Forms.dll

     目录          0  2009-12-09 17:31  test\test\obj\Debug\Refactor

     文件      20881  2009-12-16 18:41  test\test\obj\Debug\ResolveAssemblyReference.cache

     目录          0  2009-12-08 17:18  test\test\obj\Debug\TempPE

     文件       2329  2009-12-17 11:38  test\test\obj\Debug\test.csproj.FileListAbsolute.txt

     文件        847  2009-12-14 13:41  test\test\obj\Debug\test.csproj.GenerateResource.Cache

     文件        545  2009-11-23 17:02  test\test\obj\Debug\test.csproj.ResolveComReference.cache

     文件      11264  2009-12-16 18:41  test\test\obj\Debug\test.exe

     文件        180  2009-12-16 18:41  test\test\obj\Debug\test.Form1.resources

     文件      30208  2009-12-16 18:41  test\test\obj\Debug\test.pdb

     文件        180  2009-12-16 18:41  test\test\obj\Debug\test.Properties.Resources.resources

     目录          0  2009-12-16 18:41  test\test\obj\Debug

     目录          0  2009-12-08 17:18  test\test\obj

     文件        485  2009-11-23 16:43  test\test\Program.cs

     文件       1346  2009-11-23 16:43  test\test\Properties\AssemblyInfo.cs

     文件       2858  2009-11-23 16:43  test\test\Properties\Resources.Designer.cs

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

评论

共有 条评论