// static String BrailleReference = " A1B'K2L@CIF/MSP\"E3H9O6R^DJG>NTQ,*5<-U8V.%[$+X!&;:4\\0Z7(_?W]#Y)="; // static Int32 StarterIndex = 0x2800; public static void Example(Boolean EchoOff = false) { RequestHandler.CondVox("Creating an example file...", EchoOff); StreamWriter w = new StreamWriter("take your output.txt"); BrailleScreen y = new BrailleScreen(16, 12); RequestHandler.CondWait(2000, EchoOff); y[0, 0] = true; y[15, 0] = true; y[0, 8] = true; y[15, 8] = true; RequestHandler.CondVox("bum, bum, be-dum, bum, bum, be-dum, bum...", EchoOff); RequestHandler.CondWait(3000, EchoOff); BrailleScreen x = new BrailleScreen(4, 4); x[0, 0] = true; x[3, 0] = true; x[0, 2] = true; x[3, 2] = true; BrailleScreen s = BrailleScreen.Merge(x, y, 6, 3); RequestHandler.CondVox("Rendering results...", EchoOff); RequestHandler.RenderBrailleToTextFile(s, w, false); w.Close(); RequestHandler.CondWait(2000, EchoOff); RequestHandler.CondVox("Results saved to 'take your output.txt'.", EchoOff); RequestHandler.CondWait(1500, EchoOff); }
void IncreaseScreenVertically(object sender, EventArgs e) { PushScreen(); HeightNumber.Value = Math.Ceiling(HeightNumber.Value / 4) * 4; if (HeightNumber.Value > LoadedScreen.Height) { BrailleScreen x = new BrailleScreen(LoadedScreen.Width, ((UInt16)(HeightNumber.Value))); LoadedScreen = BrailleScreen.Merge(LoadedScreen, x); } else if (HeightNumber.Value < LoadedScreen.Height) { for (UInt16 y = ((UInt16)(HeightNumber.Value)); y < LoadedScreen.Height; y++) { for (UInt16 x = 0; x < LoadedScreen.Width; x++) { if (LoadedScreen[x, y]) { HeightNumber.Value = ((decimal)(LoadedScreen.Height)); return; } } } BrailleScreen bs = new BrailleScreen(LoadedScreen.Width, ((UInt16)HeightNumber.Value)); for (UInt16 y = 0; y < bs.Height; y++) { for (UInt16 x = 0; x < bs.Width; x++) { bs[x, y] = LoadedScreen[x, y]; } } LoadedScreen = bs; } RedrawElements(sender, e); HeightNumber.Value = ((decimal)(LoadedScreen.Height)); }
void IncreaseScreenHorizontally(object sender, EventArgs e) { PushScreen(); WidthNumber.Value = Math.Min(Math.Ceiling(WidthNumber.Value / 2) * 2, 1024); if (WidthNumber.Value > LoadedScreen.Width) { BrailleScreen x = new BrailleScreen(((UInt16)(WidthNumber.Value)), LoadedScreen.Height); LoadedScreen = BrailleScreen.Merge(LoadedScreen, x); } else if (WidthNumber.Value < LoadedScreen.Width) { for (UInt16 x = ((UInt16)(WidthNumber.Value)); x < LoadedScreen.Width; x++) { for (UInt16 y = 0; y < LoadedScreen.Height; y++) { if (LoadedScreen[x, y]) { WidthNumber.Value = ((decimal)(LoadedScreen.Width)); return; } } } BrailleScreen bs = new BrailleScreen((UInt16)(WidthNumber.Value), LoadedScreen.Height); for (UInt16 x = 0; x < WidthNumber.Value; x++) { for (UInt16 y = 0; y < bs.Height; y++) { bs[x, y] = LoadedScreen[x, y]; } } LoadedScreen = bs; } RedrawElements(sender, e); WidthNumber.Value = ((decimal)(LoadedScreen.Width)); }