Exemple #1
0
        private void InitializeMediaEngine()
        {
            MediaEngine = MediaEngineServiceProvider.GetMediaEngine(this);
            MediaEngine.MediaWindowDisposed += delegate(object sender, EventArgs args)
            {
                if (_mediaWindow != null)
                {
                    _mediaWindow.MessageReceived -= new EventHandler <MessageReceivedEventArgs>(_mediaWindow_MessageReceived);
                    _mediaWindow = null;
                }

                SetMediaWindowState(false);
            };

            MediaEngine.InitSize += (sender, args) =>
            {
                _rcSrc             = args.NewVideSize;
                _nativeAspectRatio = args.NativeAspectRatio;

                if (args.Initial)
                {
                    var matrix       = this.GetTargetMatrix();
                    var newVideoSize = (Size)matrix.Transform((Vector) new Size(args.NewVideSize.cx, args.NewVideSize.cy));

                    OnInitSize(newVideoSize);
                }

                ResizeNormal(args.Initial);

                if (args.InvalidateSuggested)
                {
                    InvalidateMediaWindow();
                }
            };
        }
Exemple #2
0
        private void InitializeMediaEngine()
        {
            _engine = MediaEngineServiceProvider.GetMediaEngine(this);
            _engine.MediaWindowDisposed += delegate(object sender, EventArgs args)
            {
                if (_mediaWindow != null)
                {
                    _mediaWindow.MessageReceived -= new EventHandler <MessageReceivedEventArgs>(_mediaWindow_MessageReceived);
                }

                CreateMediaWindow();
            };

            _engine.InitSize += (sender, args) =>
            {
                _rcSrc             = args.NewVideSize;
                _nativeAspectRatio = args.NativeAspectRatio;

                if (args.Initial)
                {
                    OnInitSize(new InitSizeEventArgs(new Size(args.NewVideSize.cx, args.NewVideSize.cy)));
                }

                ResizeNormal(args.Initial);

                if (args.InvalidateSuggested)
                {
                    InvalidateMediaWindow();
                }
            };
        }
 private void InitializeMediaEngine()
 {
     MediaEngine = MediaEngineServiceProvider.GetMediaEngine(this);
     MediaEngine.MediaWindowDisposed += (sender, args) => SetMediaWindowState(false);
 }