Exemple #1
0
 protected void ShowContextMenu(ImageContextMenu.MenuGroup cm)
 {
     imageCloud.ShowContextMenu(cm);
 }
Exemple #2
0
        public override void OnLoad()
        {
            SetOption(Option.BackColor, new Color4(102, 101, 96, 255));
            //SetOption(Option.BackColor, bgcolor);
            //SetOption(Option.ViewControl, ImageCloud.ViewControl.TwoDimensional);
            //SetOption(Option.ShowCoordinateSystem, false);
            //SetOption(Option.ShowLineGrid, false);
            //SetOption(Option.ShowColormap, false);
            SetOption(Option.ShowArgumentIndex, false);

            //SetOption(Option.ForceOriginalImageSize, true);

            cmImage = CreateContextMenuGroup("");

            ImageContextMenu.MenuGroup cmPlayback = CreateContextMenuGroup("Playback");
            cmImage.AddControl(cmPlayback);
            cmPlayback.AddControl(CreateContextMenuButton("TakeScreenShot", delegate(ImageContextMenu.MenuButton sender) {
                cmImage.HideImmediately();

                // Wait for the context menu to disappear
                Viewer.image_render_mutex.ReleaseMutex();
                System.Threading.Thread.Sleep(1000);
                Viewer.image_render_mutex.WaitOne();

                TakeScreenshot();
            }));
            cmPlayback.AddControl(CreateContextMenuButton("Play", delegate(ImageContextMenu.MenuButton sender) {
                Playback(2.0f);
            }));
            cmPlayback.AddControl(CreateContextMenuButton("Clear", delegate(ImageContextMenu.MenuButton sender) {
                ClearPlayback();
            }));
            cmPlayback.AddControl(CreateContextMenuButton("Record", delegate(ImageContextMenu.MenuButton sender) {
                CapturePlayback();
            }));

            ImageContextMenu.MenuGroup cmShow = CreateContextMenuGroup("Show");
            cmImage.AddControl(cmShow);
            cmShow.AddControl(CreateContextMenuButton("Argument Index", delegate(ImageContextMenu.MenuButton sender) {
                SetOption(Option.ShowArgumentIndex, true);
            }));
            cmShow.AddControl(CreateContextMenuButton("Parameter Index", delegate(ImageContextMenu.MenuButton sender) {
                SetOption(Option.ShowParameterIndex, true);
            }));
            cmShow.AddControl(CreateContextMenuButton("Colormap", delegate(ImageContextMenu.MenuButton sender) {
                SetOption(Option.ShowColormap, true);
            }));
            cmShow.AddControl(CreateContextMenuButton("Coordinate System", delegate(ImageContextMenu.MenuButton sender) {
                SetOption(Option.ShowCoordinateSystem, true);
            }));
            cmShow.AddControl(CreateContextMenuButton("Line Grid", delegate(ImageContextMenu.MenuButton sender) {
                SetOption(Option.ShowLineGrid, true);
            }));
            cmShow.AddControl(CreateContextMenuButton("Console", delegate(ImageContextMenu.MenuButton sender) {
                SetOption(Option.ShowConsole, true);
            }));

            ImageContextMenu.MenuGroup cmHide = CreateContextMenuGroup("Hide");
            cmImage.AddControl(cmHide);
            cmHide.AddControl(CreateContextMenuButton("Argument Index", delegate(ImageContextMenu.MenuButton sender) {
                SetOption(Option.ShowArgumentIndex, false);
            }));
            cmHide.AddControl(CreateContextMenuButton("Parameter Index", delegate(ImageContextMenu.MenuButton sender) {
                SetOption(Option.ShowParameterIndex, false);
            }));
            cmHide.AddControl(CreateContextMenuButton("Colormap", delegate(ImageContextMenu.MenuButton sender) {
                SetOption(Option.ShowColormap, false);
            }));
            cmHide.AddControl(CreateContextMenuButton("Coordinate System", delegate(ImageContextMenu.MenuButton sender) {
                SetOption(Option.ShowCoordinateSystem, false);
            }));
            cmHide.AddControl(CreateContextMenuButton("Line Grid", delegate(ImageContextMenu.MenuButton sender) {
                SetOption(Option.ShowLineGrid, false);
            }));
            cmHide.AddControl(CreateContextMenuButton("Console", delegate(ImageContextMenu.MenuButton sender) {
                SetOption(Option.ShowConsole, false);
            }));

            ImageContextMenu.MenuGroup cmViewMode = CreateContextMenuGroup("View Control");
            cmImage.AddControl(cmViewMode);
            cmViewMode.AddControl(CreateContextMenuButton("View Centric", delegate(ImageContextMenu.MenuButton sender) {
                SetOption(Option.ViewControl, ImageCloud.ViewControl.ViewCentric);
            }));
            cmViewMode.AddControl(CreateContextMenuButton("Coordinate System Centric", delegate(ImageContextMenu.MenuButton sender) {
                SetOption(Option.ViewControl, ImageCloud.ViewControl.CoordinateSystemCentric);
            }));
            cmViewMode.AddControl(CreateContextMenuButton("Two Dimensional", delegate(ImageContextMenu.MenuButton sender) {
                SetOption(Option.ViewControl, ImageCloud.ViewControl.TwoDimensional);
            }));

            cmImage.ComputeSize();

            //ExecuteISQL(string.Format("x all BY #theta * 3.0f"));
        }
Exemple #3
0
        public override void OnLoad()
        {
            SetOption(Option.BackColor, new Color4(102, 101, 96, 255));
            //SetOption(Option.BackColor, bgcolor);
            //SetOption(Option.ViewControl, ImageCloud.ViewControl.TwoDimensional);
            //SetOption(Option.ShowCoordinateSystem, false);
            //SetOption(Option.ShowLineGrid, false);
            //SetOption(Option.ShowColormap, false);
            SetOption(Option.ShowArgumentIndex, false);

            //SetOption(Option.ForceOriginalImageSize, true);

            cmImage = CreateContextMenuGroup("");

            ImageContextMenu.MenuGroup cmPlayback = CreateContextMenuGroup("Playback");
            cmImage.AddControl(cmPlayback);
            cmPlayback.AddControl(CreateContextMenuButton("TakeScreenShot", delegate(ImageContextMenu.MenuButton sender) {
                cmImage.HideImmediately();

                // Wait for the context menu to disappear
                Viewer.image_render_mutex.ReleaseMutex();
                System.Threading.Thread.Sleep(1000);
                Viewer.image_render_mutex.WaitOne();

                TakeScreenshot();
            }));
            cmPlayback.AddControl(CreateContextMenuButton("Play", delegate(ImageContextMenu.MenuButton sender) {
                Playback(2.0f);
            }));
            cmPlayback.AddControl(CreateContextMenuButton("Clear", delegate(ImageContextMenu.MenuButton sender) {
                ClearPlayback();
            }));
            cmPlayback.AddControl(CreateContextMenuButton("Record", delegate(ImageContextMenu.MenuButton sender) {
                CapturePlayback();
            }));

            ImageContextMenu.MenuGroup cmShow = CreateContextMenuGroup("Show");
            cmImage.AddControl(cmShow);
            cmShow.AddControl(CreateContextMenuButton("Argument Index", delegate(ImageContextMenu.MenuButton sender) {
                SetOption(Option.ShowArgumentIndex, true);
            }));
            cmShow.AddControl(CreateContextMenuButton("Parameter Index", delegate(ImageContextMenu.MenuButton sender) {
                SetOption(Option.ShowParameterIndex, true);
            }));
            cmShow.AddControl(CreateContextMenuButton("Colormap", delegate(ImageContextMenu.MenuButton sender) {
                SetOption(Option.ShowColormap, true);
            }));
            cmShow.AddControl(CreateContextMenuButton("Coordinate System", delegate(ImageContextMenu.MenuButton sender) {
                SetOption(Option.ShowCoordinateSystem, true);
            }));
            cmShow.AddControl(CreateContextMenuButton("Line Grid", delegate(ImageContextMenu.MenuButton sender) {
                SetOption(Option.ShowLineGrid, true);
            }));
            cmShow.AddControl(CreateContextMenuButton("Console", delegate(ImageContextMenu.MenuButton sender) {
                SetOption(Option.ShowConsole, true);
            }));

            ImageContextMenu.MenuGroup cmHide = CreateContextMenuGroup("Hide");
            cmImage.AddControl(cmHide);
            cmHide.AddControl(CreateContextMenuButton("Argument Index", delegate(ImageContextMenu.MenuButton sender) {
                SetOption(Option.ShowArgumentIndex, false);
            }));
            cmHide.AddControl(CreateContextMenuButton("Parameter Index", delegate(ImageContextMenu.MenuButton sender) {
                SetOption(Option.ShowParameterIndex, false);
            }));
            cmHide.AddControl(CreateContextMenuButton("Colormap", delegate(ImageContextMenu.MenuButton sender) {
                SetOption(Option.ShowColormap, false);
            }));
            cmHide.AddControl(CreateContextMenuButton("Coordinate System", delegate(ImageContextMenu.MenuButton sender) {
                SetOption(Option.ShowCoordinateSystem, false);
            }));
            cmHide.AddControl(CreateContextMenuButton("Line Grid", delegate(ImageContextMenu.MenuButton sender) {
                SetOption(Option.ShowLineGrid, false);
            }));
            cmHide.AddControl(CreateContextMenuButton("Console", delegate(ImageContextMenu.MenuButton sender) {
                SetOption(Option.ShowConsole, false);
            }));

            ImageContextMenu.MenuGroup cmViewMode = CreateContextMenuGroup("View Control");
            cmImage.AddControl(cmViewMode);
            cmViewMode.AddControl(CreateContextMenuButton("View Centric", delegate(ImageContextMenu.MenuButton sender) {
                SetOption(Option.ViewControl, ImageCloud.ViewControl.ViewCentric);
            }));
            cmViewMode.AddControl(CreateContextMenuButton("Coordinate System Centric", delegate(ImageContextMenu.MenuButton sender) {
                SetOption(Option.ViewControl, ImageCloud.ViewControl.CoordinateSystemCentric);
            }));
            cmViewMode.AddControl(CreateContextMenuButton("Two Dimensional", delegate(ImageContextMenu.MenuButton sender) {
                SetOption(Option.ViewControl, ImageCloud.ViewControl.TwoDimensional);
            }));

            cmImage.ComputeSize();

            //ExecuteISQL(string.Format("x all BY #theta * 3.0f"));
        }