/// <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); }
// 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(); }
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 { } }