コード例 #1
0
ファイル: CanvasViewer.cs プロジェクト: windygu/hispeed
 void canvasHost1_Load(object sender, EventArgs e)
 {
     canvasHost1.Canvas.Container.MouseMove += new MouseEventHandler(Container_MouseMove);
     canvasHost1.Canvas.Container.MouseDown += new MouseEventHandler(Container_MouseDown);
     canvasHost1.Canvas.OnEnvelopeChanged   += new EventHandler((senser, arg) =>
     {
         if (_onCoordEnvelopeChanged != null)
         {
             _onCoordEnvelopeChanged(this, null);
         }
     });
     canvasHost1.Canvas.Container.Paint += new PaintEventHandler(Container_Paint);
     //
     _initializer        = new CanvasViewerInitializer(canvasHost1.Canvas, _session);
     _aoiProvider        = new AOIProvider(canvasHost1.Canvas);
     _rasterInteractiver = new CurrentRasterInteractiver(this);
     //
     canvasHost1.Canvas.AOIGetter = () =>
     {
         return(_aoiProvider.GetBitmapIndexes());
     };
     canvasHost1.Canvas.MaskGetter = () =>
     {
         return(AOIHelper.Reverse(_aoiProvider.GetBitmapIndexes(), _aoiProvider.BitmapSize));
     };
     //
     CreateVectorHost();
 }
コード例 #2
0
ファイル: CanvasViewer.cs プロジェクト: windygu/hispeed
 void IDisposable.Dispose()
 {
     if (_initializer != null)
     {
         _initializer.Dispose();
         _initializer = null;
     }
     if (_aoiProvider != null)
     {
         _aoiProvider.Dispose();
         _aoiProvider = null;
     }
     if (canvasHost1 != null && canvasHost1.Canvas != null)
     {
         RemoveCanvasViewEnv();
     }
     this.Controls.Remove(canvasHost1);
     canvasHost1.Load -= new EventHandler(canvasHost1_Load);
     canvasHost1.DisposeView();
     canvasHost1             = null;
     _session                = null;
     _onCoordEnvelopeChanged = null;
     _pickColorIsFinished    = null;
 }