资源简介
最后通过ffmpeg转换,比较耗时,不过可以参考
代码片段和文件信息
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Drawing;
using System.Drawing.Imaging;
using System.Runtime.InteropServices;
using System.IO;
namespace Peeper {
static class Extensions {
/*public static byte[] ToByteArray(this Image Img ImageFormat Fmt) {
using (MemoryStream MS = new MemoryStream()) {
Img.Save(MS Fmt);
return MS.ToArray();
}
}*/
public static byte[] ToByteArray(this Bitmap Img PixelFormat PFmt = PixelFormat.Format24bppRgb) {
BitmapData BmpData = Img.LockBits(new Rectangle(Point.Empty Img.Size) ImageLockMode.ReadOnly PFmt);
int Len = BmpData.Stride * BmpData.Height;
byte[] Bytes = new byte[Len];
Marshal.Copy(BmpData.Scan0 Bytes 0 Len);
Img.UnlockBits(BmpData);
return Bytes;
}
public static Point Add(this Point A Point B) {
return new Point(A.X + B.X A.Y + B.Y);
}
public static Point Subtract(this Point A Point B) {
return new Point(A.X - B.X A.Y - B.Y);
}
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2016-09-08 15:23 Peeper-master\
文件 2906 2015-12-06 12:03 Peeper-master\.gitignore
目录 0 2016-09-08 15:23 Peeper-master\.vs\
目录 0 2016-09-08 15:23 Peeper-master\.vs\Peeper\
目录 0 2016-09-08 15:23 Peeper-master\.vs\Peeper\v14\
文件 77312 2016-09-13 10:21 Peeper-master\.vs\Peeper\v14\.suo
目录 0 2016-09-08 15:23 Peeper-master\3rdParty\
目录 0 2016-09-08 15:23 Peeper-master\3rdParty\CodeContracts\
文件 61440 2015-12-06 12:03 Peeper-master\3rdParty\CodeContracts\SharpAvi.Contracts.dll
文件 120532 2015-12-06 12:03 Peeper-master\3rdParty\SharpAvi.xm
文件 77824 2015-12-06 12:03 Peeper-master\3rdParty\SharpAvi.dll
文件 1211 2015-12-06 12:03 Peeper-master\LICENSE
目录 0 2016-09-08 15:23 Peeper-master\Peeper\
文件 182 2015-12-06 12:03 Peeper-master\Peeper\App.config
文件 1044 2015-12-06 12:03 Peeper-master\Peeper\Extensions.cs
文件 4048 2016-09-05 10:01 Peeper-master\Peeper\Peeper.csproj
文件 2865 2016-09-05 17:37 Peeper-master\Peeper\PeeperForm.Designer.cs
文件 7119 2016-09-06 13:20 Peeper-master\Peeper\PeeperForm.cs
文件 5817 2016-09-05 17:37 Peeper-master\Peeper\PeeperForm.resx
文件 693 2016-09-05 10:53 Peeper-master\Peeper\Program.cs
目录 0 2016-09-08 15:23 Peeper-master\Peeper\Properties\
文件 1388 2015-12-06 12:03 Peeper-master\Peeper\Properties\AssemblyInfo.cs
文件 2403 2015-12-06 12:03 Peeper-master\Peeper\Properties\Resources.Designer.cs
文件 5496 2015-12-06 12:03 Peeper-master\Peeper\Properties\Resources.resx
文件 979 2015-12-06 12:03 Peeper-master\Peeper\Properties\Settings.Designer.cs
文件 242 2015-12-06 12:03 Peeper-master\Peeper\Properties\Settings.settings
目录 0 2016-09-08 15:23 Peeper-master\Peeper\obj\
目录 0 2016-09-08 15:23 Peeper-master\Peeper\obj\Debug\
文件 35345 2016-09-05 09:47 Peeper-master\Peeper\obj\Debug\DesignTimeResolveAssemblyReferences.cache
文件 7000 2016-09-13 10:20 Peeper-master\Peeper\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
文件 180 2016-09-05 17:37 Peeper-master\Peeper\obj\Debug\Peeper.PeeperForm.resources
............此处省略23个文件信息
- 上一篇:超赞的200个经典C#WinForm
- 下一篇:ASP.NET电影网站(毕业设计)
评论
共有 条评论