예제 #1
0
 public void Unload()
 {
     updateTimer.Stop();
     updateTimer.Dispose();
     imageTexture.Dispose();
     imagePanel.Dispose();
     updateTimer      = null;
     imagePanel       = null;
     visualizerCanvas = null;
     imageTexture     = null;
     visualizerImage  = null;
 }
예제 #2
0
        public void Load(IServiceProvider provider, int width, int height)
        {
            visualizerCanvas = new VisualizerCanvas {
                Dock = DockStyle.Fill
            };
            visualizerCanvas.RenderFrame += (sender, e) => RenderFrame();
            visualizerCanvas.Load        += (sender, e) => imageTexture = new IplImageTexture();
            imagePanel = new Panel {
                Dock = DockStyle.Fill, Size = new Size(width, height)
            };
            imagePanel.Controls.Add(visualizerCanvas);

            var visualizerService = (IDialogTypeVisualizerService)provider.GetService(typeof(IDialogTypeVisualizerService));

            if (visualizerService != null)
            {
                updateTimer          = new Timer();
                updateTimer.Interval = TargetInterval;
                updateTimer.Tick    += updateTimer_Tick;
                visualizerService.AddControl(imagePanel);
                updateTimer.Start();
            }
        }