資源簡介
此資源能實現對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個文件信息
評論
共有 條評論