コード例 #1
0
        /// <summary>
        /// Generates the main screen consisting of title (top region), detail region and center region.
        /// </summary>
        /// <param name="width">The width.</param>
        /// <param name="height">The height.</param>
        /// <param name="view">The view of the main region.</param>
        /// <returns></returns>
        BrailleIOScreen buildMainScreen(int width, int height, LectorView view)
        {
            BrailleIOScreen mainScreen = new BrailleIOScreen(BS_MAIN_NAME);

            mainScreen.SetHeight(height);
            mainScreen.SetWidth(width);

            var center = getMainScreenCenterRegion(0, 0, width, height);

            center.ShowScrollbars = true;
            var center2 = getMainScreenCenter2Region(0, 0, width, height);

            center2.ShowScrollbars = true;
            center2.SetVisibility(false);
            center2.SetZoom(1);

            var top    = getMainTopRegion(0, 0, width, 7);
            var status = getMainStatusRegion(width - 12, 0, 12, 5);

            status.SetText(LectorStateNames.STANDARD_MODE);

            var detail = getMainDetailRegion(0, height - 7, width, 7);

            detail.ShowScrollbars = true;                                         // make the region scrollable
            // make the BrailleRenderer to ignore the last line space
            detail.SetText(LL.GetTrans("tangram.lector.wm.no_element_selected")); // set text to enable the BrailleRenderer
            var renderer = detail.ContentRender;

            if (renderer != null && renderer is MatrixBrailleRenderer)
            {
                ((MatrixBrailleRenderer)renderer).RenderingProperties |= RenderingProperties.IGNORE_LAST_LINESPACE;
            }

            mainScreen.AddViewRange(VR_CENTER_2_NAME, center2);
            mainScreen.AddViewRange(VR_CENTER_NAME, center);
            mainScreen.AddViewRange(VR_TOP_NAME, top);
            mainScreen.AddViewRange(VR_STATUS_NAME, status);
            mainScreen.AddViewRange(VR_DETAIL_NAME, detail);

            setRegionContent(mainScreen, VR_TOP_NAME, MAINSCREEN_TITLE);
            setRegionContent(mainScreen, VR_DETAIL_NAME, LL.GetTrans("tangram.lector.wm.no_element_selected"));

            currentView = view;
            fillMainCenterContent(mainScreen);

            if (io != null)
            {
                io.AddView(BS_MAIN_NAME, mainScreen);
                io.ShowView(BS_MAIN_NAME);
                io.RefreshDisplay(true);
            }
            return(mainScreen);
        }
コード例 #2
0
        //     string path = "";
        private void showExample()
        {
            BrailleIOScreen s = new BrailleIOScreen();

            #region Center Region

            #region screenshot
            Image bmp = captureScreen();
            #endregion

            BrailleIOViewRange center = new BrailleIOViewRange(0, 7, 120, 46, new bool[120, 40]);
            //center.Move(1,1);

            center.SetBitmap(bmp);

            center.SetZoom(-1);
            center.SetBorder(0);
            center.SetContrastThreshold(150);
            center.ShowScrollbars = true;

            s.AddViewRange("center", center);

            #endregion

            #region Top Reagion
            BrailleIOViewRange top = new BrailleIOViewRange(0, 0, 120, 7);

            top.SetBorder(0, 0, 1);
            top.SetMargin(0, 0, 1);
            top.SetPadding(0, 0, 1);

            top.SetText("ABCDEFGHIJKLMNOPQRSTUVWXYZ\r\nabcdefghijklmnopqrstuvwxyz\r\n0123456789!\"#$%&<=>?@©®\r\n*+-~:;[],.'^_`(){}/|\\r\nß\r\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r\n");
            top.SetText("Tactile screen capture");
            s.AddViewRange("top", top);

            #endregion

            #region Bottom Reagion
            BrailleIOViewRange bottom = new BrailleIOViewRange(0, 53, 120, 7);

            bottom.SetBorder(1, 0, 0);
            bottom.SetMargin(1, 0, 0);
            bottom.SetPadding(1, 0, 0);

            bottom.SetText("Detail area: status messages can be shown");

            s.AddViewRange("bottom", bottom);
            #endregion

            io.AddView(BS_MAIN_NAME, s);
            io.ShowView(BS_MAIN_NAME);
            io.RenderDisplay();
        }
コード例 #3
0
        System.Timers.Timer gestureTimer           = new System.Timers.Timer(100);  // controls how often touch points are interpreted into gestures on the HyperBraille

        // constructor - initialize the HyperBraille Device
        public HyperBrailleInterface()
        {
            AbstractBrailleIOAdapterManagerBase manager = new BasicBrailleIOAdapterManager();   // main instance manager

            if (manager != null)
            {
                brailledis = new BrailleIOAdapter_BrailleDisNet(manager);
                brailledis.touchValuesChanged += brailledis_touchValuesChanged;              // add a listener for gesture recognition
                if (io != null)
                {
                    io.AdapterManager = manager;
                }
            }

            io.AddView("Mainscreen", mainscreen);                                           // add the mainscreen to the HyperBraille Device
            mainscreen.AddViewRange("Blank Screen", new BrailleIOViewRange(0, 0, 120, 60)); // add a blank view to cover the entirety of the device

            selectionTimer.Elapsed += selectionTimer_Elapsed;                               // set the method to determine what happens when the selection timer blinks
            gestureTimer.Elapsed   += analyzeGesture_Elapsed;                               // set the method to determine what happens when the gesture timer blinks
        }
コード例 #4
0
        private void setTangramScreen()
        {
            try
            {
                if (io != null)
                {
                    string          name = "TangramSceen";
                    BrailleIOScreen ts   = new BrailleIOScreen(name);

                    BrailleIOViewRange tv = new BrailleIOViewRange(0, 0, io.GetDeviceSizeX(), io.GetDeviceSizeY());
                    tv.SetBitmap(Bitmap.FromFile(@"config/pics/tactile_logo.bmp"));
                    ts.AddViewRange(name + "View", tv);
                    io.AddView(name, ts);
                    io.ShowView(name);
                    io.RefreshDisplay();
                    io.RefreshDisplay();
                    System.Threading.Thread.Sleep(10);
                }
            }
            catch { }
        }