예제 #1
0
        private static void InnerShow(string absolutePath, int _displayMonitor)
        {
            ForeachVideoRenders((_videoRender, screen, index) =>
            {
                if (_displayMonitor == index || _displayMonitor < 0)
                {
                    if (_videoRender == null || _videoRender.RenderDisposed)
                    {
                        Execute.OnUIThread(() =>
                        {
                            _videoRender = new VideoRender();
                            _videoRender.Init(screen);

                            InnerApplyVideoAspect(_videoRender, VideoAspect, screen);

                            bool ok = LiveWallpaperEngineManager.Show(_videoRender, screen);
                            if (!ok)
                            {
                                LiveWallpaperEngineManager.Close(_videoRender);
                                System.Windows.MessageBox.Show("巨应壁纸貌似不能正常工作,请关闭杀软重试");
                            }
                            else
                            {
                                _videoRenders[index] = _videoRender;
                            }
                        });
                    }
                }
                _videoRender?.Play(absolutePath);
                if (index == _audioSourceMonitor)
                {
                    _videoRender?.Mute(false);
                }
            });
        }
예제 #2
0
 public static void InitMonitor(int displayMonitor)
 {
     _displayMonitor = displayMonitor;
     ForeachVideoRenders((render, screen, i) =>
     {
         if (displayMonitor > -1 && i != displayMonitor)
         {
             LiveWallpaperEngineManager.Close(render);
             _videoRenders[i] = null;
         }
     });
 }
예제 #3
0
 private void btnCloseCustomHandle_Click(object sender, RoutedEventArgs e)
 {
     LiveWallpaperEngineManager.Close(_handleRender);
 }
예제 #4
0
        private void btnCloseProcess_Click(object sender, RoutedEventArgs e)
        {
            var btn = sender as Button;

            LiveWallpaperEngineManager.Close(_handleRender);
        }