嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):813200300
本次赞助数额为: 20 元微信扫码支付:20 元
请留下您的邮箱,我们将在2小时内将文件发到您的邮箱
点击“视频列表选择”,再需要播放前面打勾,点击“确定选择”。上边“播”放为预览,下边“OK”为桌面背景播放
点击“动画壁纸”,在下边点击“选择动画列表”,选中的打勾,关闭。上边“播”放为预览,下边“OK”为桌面背景播放
可播放本地视频、网络视频、动画作为系统桌面背景,自动循环播放列表。
可当做小工具直接使用,也可以参考代码自行修改,支持Windows 10、Windows 7。
有兴趣的可以搞一个小项目,设立一个自己的网站,可从网站更新动态桌面壁纸发送到客户端。
已将需要的库加入代码中,可调试运行(x86、允许不安全)。
支持
dvd://;"vcd://";"cdda://";"bluray://";"rtp://";"rtsp://";"http://";"udp://";"mms://";"dshow://";
"screen://";"fake://";"imem://";...........
等方式,
支持文件类型:
"*.3g2","*.3pg","*.3gp2","*.3gpp","*.amv","*.asf","*.avi","*.bik","*.divx","*.drc","*.dv","*.f4v",
"*.flv","*.gvi","*.gfx","*.m1v","*.m2v","*.m2t","*.m2ts","*.m4v","*.mkv","*.mov",
"*.mp2","*.mp2v","*.mp4","*.mp4v","*.mpe","*.mpeg","*.mpeg1","*.mpeg2","*.mpeg4",
"*.mpg","*.mpv2","*.mts","*.mtv","*.mxf","*.mxg","*.nsv","*.nuv","*.ogg","*.ogm",
"*.ogv","*.ogx","*.ps","*.rec","*.rm","*.rmvb","*.rpl","*.thp","*.tod","*.ts","*.tts","*.txd","*.vob",
"*.vro","*.webm","*.wm","*.wmv","*.wtv","*.xesc"......等。
采用VLC的DLL和FireFox的DLL,.NET为4.5版本。如需更高版本可直接从VS的NuGet中获得。
除VLC、FireFox基础DLL外,其余全部源码,并在重点部分加注了说明。
VLC与FireFox是有冲突的,代码中需进行调整可避免,已加了标注。
原VLC会有锁死情况,这里也通过代码进行了避免,在CS文件中进行查看。
注意:
如使用集成显卡,则开始壁纸播放时会挡住桌面图标,按下“Win” “D”组合键可正常使用。
public static Image TransparentImage(Image srcImage, float opacity) { float[][] nArray ={ new float[] {1, 0, 0, 0, 0}, new float[] {0, 1, 0, 0, 0}, new float[] {0, 0, 1, 0, 0}, new float[] {0, 0, 0, opacity, 0}, new float[] {0, 0, 0, 0, 1}}; ColorMatrix matrix = new ColorMatrix(nArray); ImageAttributes attributes = new ImageAttributes(); attributes.SetColorMatrix(matrix, ColorMatrixFlag.Default, ColorAdjustType.Bitmap); Bitmap resultImage = new Bitmap(srcImage.Width, srcImage.Height); Graphics g = Graphics.FromImage(resultImage); g.DrawImage(srcImage, new Rectangle(0, 0, srcImage.Width, srcImage.Height), 0, 0, srcImage.Width, srcImage.Height, GraphicsUnit.Pixel, attributes); return resultImage; } public static class Win32 { [DllImport("user32.dll")] public static extern IntPtr FindWindow(string className, string winName); [DllImport("user32.dll")] public static extern IntPtr SendMessageTimeout(IntPtr hwnd, uint msg, IntPtr wParam, IntPtr lParam, uint fuFlage, uint timeout, IntPtr result); [DllImport("user32.dll")] public static extern bool EnumWindows(EnumWindowsProc proc, IntPtr lParam); public delegate bool EnumWindowsProc(IntPtr hwnd, IntPtr lParam); [DllImport("user32.dll")] public static extern IntPtr FindWindowEx(IntPtr hwndParent, IntPtr hwndChildAfter, string className, string winName); [DllImport("user32.dll")] public static extern bool ShowWindow(IntPtr hwnd, int nCmdShow); [DllImport("user32.dll")] public static extern IntPtr SetParent(IntPtr hwnd, IntPtr parentHwnd); } public static IntPtr programIntPtr = IntPtr.Zero; public static void Init() { programIntPtr = Win32.FindWindow("Progman", null); if (programIntPtr != IntPtr.Zero) { IntPtr result = IntPtr.Zero; Win32.SendMessageTimeout(programIntPtr, 0x52c, IntPtr.Zero, IntPtr.Zero, 0, 0x3e8, result); Win32.EnumWindows((hwnd, lParam) => { if (Win32.FindWindowEx(hwnd, IntPtr.Zero, "SHELLDLL_DefView", null) != IntPtr.Zero) { IntPtr tempHwnd = Win32.FindWindowEx(IntPtr.Zero, hwnd, "WorkerW", null); Win32.ShowWindow(tempHwnd, 0); } return true; }, IntPtr.Zero); } } [DllImport("kernel32.dll", EntryPoint = "SetProcessWorkingSetSize")] public static extern int SetProcessWorkingSetSize(IntPtr process, int minSize, int maxSize); public static void ClearMemory() { GC.Collect(); GC.WaitForPendingFinalizers(); if (Environment.OSVersion.Platform == PlatformID.Win32NT) { SetProcessWorkingSetSize(Process.GetCurrentProcess().Handle, -1, -1); } }