/// <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); }
// refresh the display on the HyperBraille Device private void Refresh() { if (io != null) { io.RefreshDisplay(); } }
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 { } }
internal void updateScreenshotInCenterVr() { if (io != null) { var v = io.GetView(BS_MAIN_NAME) as BrailleIOScreen; if (v != null) { var cs = v.GetViewRange("center"); if (cs != null) { cs.SetBitmap(captureScreen()); io.RefreshDisplay(true); } } } }