Exemplo n.º 1
0
 public override void writeBinary(BinaryWriter bw)
 {
     // Writing binary/design criteria for Rectangle
     bw.Write("Rect");
     bw.Write(PenColor.ToArgb());
     bw.Write(PenWidth);
     bw.Write(Pt1.X); bw.Write(Pt1.Y);
     bw.Write(Pt2.X); bw.Write(Pt2.Y);
 }
Exemplo n.º 2
0
 public override void writeBinary(BinaryWriter bw)
 {
     // YOUR CODE HERE
     bw.Write("Rectangle");
     bw.Write(Pt1.X);
     bw.Write(Pt1.Y);
     bw.Write(Pt2.X);
     bw.Write(Pt2.Y);
     bw.Write((int)PenWidth);
     bw.Write(PenColor.ToArgb());
 }
Exemplo n.º 3
0
        public override void writeBinary(BinaryWriter bw)
        {
            // Writing binary/design criteria for Line


            bw.Write("Line");
            bw.Write(Pt1.X); bw.Write(Pt1.Y);
            bw.Write(Pt2.X); bw.Write(Pt2.Y);
            bw.Write(PenColor.ToArgb());
            bw.Write((int)PenWidth);
        }
Exemplo n.º 4
0
 public override void writeBinary(BinaryWriter bw)
 {
     // Writing binary/design criteria for Free Line
     bw.Write("FreeLine");
     bw.Write(PenColor.ToArgb());
     bw.Write(PenWidth);
     bw.Write(FreeList.Count);
     foreach (Point pointElement in FreeList)
     {
         bw.Write(pointElement.X); bw.Write(pointElement.Y);
     }
 }
Exemplo n.º 5
0
        public void GetObjectData(SerializationInfo info, StreamingContext context)
        {
            info.AddValue("ShapeId", ShapeId);
            info.AddValue("CurrentShape", CurrentShape);
            info.AddValue("BrushType", BrushType);
            info.AddValue("PenType", PenType);
            info.AddValue("Width", ShapeSize.Width);
            info.AddValue("Height", ShapeSize.Height);

            info.AddValue("X", ShapeLoc.X);
            info.AddValue("Y", ShapeLoc.Y);

            info.AddValue("PenColor", PenColor.ToArgb());
            info.AddValue("BrushColor", BrushColor.ToArgb());
            info.AddValue("IsBrush", IsBrush);
        }
Exemplo n.º 6
0
        public override void writeBinary(BinaryWriter bw)
        {
            // YOUR CODE HERE
            bw.Write("Text");
            bw.Write(Pt1.X);
            bw.Write(Pt1.Y);
            bw.Write(TextLine);
            //  bw.Write((String)TextFont.FontFamily);
            var cvt = new FontConverter();

            bw.Write(TextFont.FontFamily.Name);
            bw.Write(TextFont.Size);
            bw.Write(PenColor.ToArgb());

            Console.WriteLine("Text data :" + ToString());
        }
Exemplo n.º 7
0
        public override void writeBinary(BinaryWriter bw)
        {
            // YOUR CODE HERE

            bw.Write("FreeLine");
            bw.Write((int)PenWidth);
            bw.Write(PenColor.ToArgb());
            Point[] pts = FreeList.ToArray();
            bw.Write(pts.Length);
            foreach (Point p in FreeList)
            {
                bw.Write(p.X);
                bw.Write(p.Y);
            }
            bw.Write("\n");
        }
Exemplo n.º 8
0
 private Pen(PenColor _color)
 {
     Color = _color;
 }
 public override string ToString()
 {
     return(Adapter.ToString() + " " + PenColor.ToString());
 }
Exemplo n.º 10
0
 public void changeColor(PenColor color)
 {
     this.Color = color;
 }
Exemplo n.º 11
0
 public Pen(string name, PenColor color)
 {
     this.Name  = name;
     this.Color = color;
 }
Exemplo n.º 12
0
 public override string txtSerialize()
 {
     return(string.Format("{0},{1},{2},{3},{4},{5},{6},{7}", Name, StartPoint.X, StartPoint.Y, radius, FillColor.ToKnownColor(), FillStyle, PenColor.ToKnownColor(), PenWidth));
 }
Exemplo n.º 13
0
 public void SetPenColor(PenColor color)
 {
     pencolor = color;
 }
Exemplo n.º 14
0
 public override string txtSerialize()
 {
     return(string.Format("{0},{1},{2},{3},{4},{5},{6}", Name, StartPoint.X, StartPoint.Y, EndPoint.X, EndPoint.Y, PenColor.ToKnownColor(), PenWidth));
 }
Exemplo n.º 15
0
 public override string txtSerialize()
 {
     return(string.Format("{0}:{1}:{2}:{3}:{4}:{5}", Name, StartPoint.X, StartPoint.Y, PenColor.ToKnownColor(), PenWidth, Points));
 }
Exemplo n.º 16
0
        public static void GeneratePresentationPropertiesPart1Content(PresentationPropertiesPart presentationPropertiesPart1)
        {
            PresentationProperties presentationProperties1 = new PresentationProperties();

            presentationProperties1.AddNamespaceDeclaration("a", "http://schemas.openxmlformats.org/drawingml/2006/main");
            presentationProperties1.AddNamespaceDeclaration("r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships");
            presentationProperties1.AddNamespaceDeclaration("p", "http://schemas.openxmlformats.org/presentationml/2006/main");

            ShowProperties showProperties1 = new ShowProperties()
            {
                ShowNarration = true
            };
            PresenterSlideMode presenterSlideMode1 = new PresenterSlideMode();
            SlideAll           slideAll1           = new SlideAll();

            PenColor penColor1 = new PenColor();

            A.PresetColor presetColor6 = new A.PresetColor()
            {
                Val = A.PresetColorValues.Red
            };

            penColor1.Append(presetColor6);

            ShowPropertiesExtensionList showPropertiesExtensionList1 = new ShowPropertiesExtensionList();

            ShowPropertiesExtension showPropertiesExtension1 = new ShowPropertiesExtension()
            {
                Uri = "{EC167BDD-8182-4AB7-AECC-EB403E3ABB37}"
            };

            P14.LaserColor laserColor1 = new P14.LaserColor();
            laserColor1.AddNamespaceDeclaration("p14", "http://schemas.microsoft.com/office/powerpoint/2010/main");
            A.RgbColorModelHex rgbColorModelHex265 = new A.RgbColorModelHex()
            {
                Val = "FF0000"
            };

            laserColor1.Append(rgbColorModelHex265);

            showPropertiesExtension1.Append(laserColor1);

            ShowPropertiesExtension showPropertiesExtension2 = new ShowPropertiesExtension()
            {
                Uri = "{2FDB2607-1784-4EEB-B798-7EB5836EED8A}"
            };

            P14.ShowMediaControls showMediaControls1 = new P14.ShowMediaControls()
            {
                Val = true
            };
            showMediaControls1.AddNamespaceDeclaration("p14", "http://schemas.microsoft.com/office/powerpoint/2010/main");

            showPropertiesExtension2.Append(showMediaControls1);

            showPropertiesExtensionList1.Append(showPropertiesExtension1);
            showPropertiesExtensionList1.Append(showPropertiesExtension2);

            showProperties1.Append(presenterSlideMode1);
            showProperties1.Append(slideAll1);
            showProperties1.Append(penColor1);
            showProperties1.Append(showPropertiesExtensionList1);

            ColorMostRecentlyUsed colorMostRecentlyUsed1 = new ColorMostRecentlyUsed();

            A.RgbColorModelHex rgbColorModelHex266 = new A.RgbColorModelHex()
            {
                Val = "F15A29"
            };
            A.RgbColorModelHex rgbColorModelHex267 = new A.RgbColorModelHex()
            {
                Val = "9E1F63"
            };
            A.RgbColorModelHex rgbColorModelHex268 = new A.RgbColorModelHex()
            {
                Val = "262261"
            };
            A.RgbColorModelHex rgbColorModelHex269 = new A.RgbColorModelHex()
            {
                Val = "ED1C24"
            };
            A.RgbColorModelHex rgbColorModelHex270 = new A.RgbColorModelHex()
            {
                Val = "91278F"
            };
            A.RgbColorModelHex rgbColorModelHex271 = new A.RgbColorModelHex()
            {
                Val = "29AAE2"
            };
            A.RgbColorModelHex rgbColorModelHex272 = new A.RgbColorModelHex()
            {
                Val = "2E3192"
            };
            A.RgbColorModelHex rgbColorModelHex273 = new A.RgbColorModelHex()
            {
                Val = "BF1E2D"
            };

            colorMostRecentlyUsed1.Append(rgbColorModelHex266);
            colorMostRecentlyUsed1.Append(rgbColorModelHex267);
            colorMostRecentlyUsed1.Append(rgbColorModelHex268);
            colorMostRecentlyUsed1.Append(rgbColorModelHex269);
            colorMostRecentlyUsed1.Append(rgbColorModelHex270);
            colorMostRecentlyUsed1.Append(rgbColorModelHex271);
            colorMostRecentlyUsed1.Append(rgbColorModelHex272);
            colorMostRecentlyUsed1.Append(rgbColorModelHex273);

            PresentationPropertiesExtensionList presentationPropertiesExtensionList1 = new PresentationPropertiesExtensionList();

            PresentationPropertiesExtension presentationPropertiesExtension1 = new PresentationPropertiesExtension()
            {
                Uri = "{E76CE94A-603C-4142-B9EB-6D1370010A27}"
            };

            P14.DiscardImageEditData discardImageEditData1 = new P14.DiscardImageEditData()
            {
                Val = false
            };
            discardImageEditData1.AddNamespaceDeclaration("p14", "http://schemas.microsoft.com/office/powerpoint/2010/main");

            presentationPropertiesExtension1.Append(discardImageEditData1);

            PresentationPropertiesExtension presentationPropertiesExtension2 = new PresentationPropertiesExtension()
            {
                Uri = "{D31A062A-798A-4329-ABDD-BBA856620510}"
            };

            P14.DefaultImageDpi defaultImageDpi1 = new P14.DefaultImageDpi()
            {
                Val = (UInt32Value)220U
            };
            defaultImageDpi1.AddNamespaceDeclaration("p14", "http://schemas.microsoft.com/office/powerpoint/2010/main");

            presentationPropertiesExtension2.Append(defaultImageDpi1);

            PresentationPropertiesExtension presentationPropertiesExtension3 = new PresentationPropertiesExtension()
            {
                Uri = "{FD5EFAAD-0ECE-453E-9831-46B23BE46B34}"
            };

            P15.ChartTrackingReferenceBased chartTrackingReferenceBased1 = new P15.ChartTrackingReferenceBased()
            {
                Val = false
            };
            chartTrackingReferenceBased1.AddNamespaceDeclaration("p15", "http://schemas.microsoft.com/office/powerpoint/2012/main");

            presentationPropertiesExtension3.Append(chartTrackingReferenceBased1);

            presentationPropertiesExtensionList1.Append(presentationPropertiesExtension1);
            presentationPropertiesExtensionList1.Append(presentationPropertiesExtension2);
            presentationPropertiesExtensionList1.Append(presentationPropertiesExtension3);

            presentationProperties1.Append(showProperties1);
            presentationProperties1.Append(colorMostRecentlyUsed1);
            presentationProperties1.Append(presentationPropertiesExtensionList1);

            presentationPropertiesPart1.PresentationProperties = presentationProperties1;
        }
Exemplo n.º 17
0
 public override void writeBinary(BinaryWriter bw)
 {
     // Writing binary/design criteria for Text
     bw.Write("Text");
     bw.Write(Pt1.X + "," + Pt1.Y + "," + TextLine + "," + TextFont.FontFamily.Name + "," + TextFont.SizeInPoints + "," + PenColor.ToArgb());
 }
Exemplo n.º 18
0
        public IEnumerable <PPMFrame> ThreeColorFrames(string Folder, PenColor color)
        {
            var images = Directory.GetFiles($"{Folder}", "*.png");

            MathUtils.NumericalSort(images);
            PPMFrame PreviousFrame = null;

            for (int i = 0; i < images.Length; i++)
            {
                PPMFrame frame = new PPMFrame();

                Rgba32 ColorBlue  = Rgba32.ParseHex("#0000ff");
                Rgba32 ColorRed   = Rgba32.ParseHex("#FF0000");
                Rgba32 ColorBlack = Rgba32.ParseHex("#000000");
                Rgba32 ColorWhite = Rgba32.ParseHex("FFFFFF");

                var ColorImage = (Image <Rgba32>)Image.Load($"{Folder}/frame_{i}.png");
                int black      = 0;
                int white      = 0;
                for (int x = 0; x < 256; x++)
                {
                    for (int y = 0; y < 192; y++)
                    {
                        frame.Layer1.SetLineEncoding(y, LineEncoding.CodedLine);
                        frame.Layer2.SetLineEncoding(y, LineEncoding.CodedLine);

                        var ColorPixel     = ColorImage[x, y];
                        var ColorLuminance = (0.299 * ColorPixel.R + 0.587 * ColorPixel.G + 0.114 * ColorPixel.B) / 255;

                        var Red   = ColorPixel == ColorRed;
                        var Blue  = ColorPixel == ColorBlue;
                        var White = ColorPixel == ColorWhite;
                        var Black = ColorPixel == ColorBlack;

                        if (Red)
                        {
                            frame.Layer2[x, y] = true;
                            frame.Layer1[x, y] = false;
                        }
                        if (Blue)
                        {
                            frame.Layer2[x, y] = true;
                            frame.Layer1[x, y] = false;
                        }
                        if (White)
                        {
                            frame.Layer2[x, y] = false;
                            frame.Layer1[x, y] = false;
                            white++;
                        }
                        if (Black)
                        {
                            frame.Layer2[x, y] = false;
                            frame.Layer1[x, y] = true;
                            black++;
                        }
                    }
                }

                if (black > white)
                {
                    for (int x = 0; x < 256; x++)
                    {
                        for (int y = 0; y < 192; y++)
                        {
                            var ColorPixel     = ColorImage[x, y];
                            var ColorLuminance = (0.299 * ColorPixel.R + 0.587 * ColorPixel.G + 0.114 * ColorPixel.B) / 255;

                            var Red   = ColorPixel == ColorRed;
                            var Blue  = ColorPixel == ColorBlue;
                            var White = ColorPixel == ColorWhite;
                            var Black = ColorPixel == ColorBlack;

                            if (Red)
                            {
                                frame.Layer2[x, y] = true;
                                frame.Layer1[x, y] = false;
                            }
                            if (Blue)
                            {
                                frame.Layer2[x, y] = true;
                                frame.Layer1[x, y] = false;
                            }
                            if (White)
                            {
                                frame.Layer2[x, y] = false;
                                frame.Layer1[x, y] = true;
                            }
                            if (Black)
                            {
                                frame.Layer2[x, y] = false;
                                frame.Layer1[x, y] = false;
                            }
                        }
                    }
                }
                byte header = 0;
                if (i == 0)
                {
                    header |= 1 << 7; // no frame diffing
                }
                header |= (byte)(((int)color) << 3);
                header |= (byte)(((int)PenColor.Inverted) << 1);
                header |= (byte)(white > black ? 1 : 0);
                frame._firstByteHeader = header;

                frame.PaperColor      = (PaperColor)(frame._firstByteHeader % 2);
                frame.Layer1.PenColor = (PenColor)((frame._firstByteHeader >> 1) & 3);
                frame.Layer2.PenColor = (PenColor)((frame._firstByteHeader >> 3) & 3);

                if (i == 0)
                {
                    PreviousFrame = frame;
                    yield return(frame);
                }
                else
                {
                    var temp = frame.CreateDiff0(PreviousFrame);
                    PreviousFrame = frame;
                    yield return(temp);
                }
            }
        }
Exemplo n.º 19
0
        public static string Decode(int lineIndex, byte[] bytes, CommandState state, bool flush)
        {
            var i  = 0;
            var sb = new StringBuilder();

            while (i < bytes.Length)
            {
                var b = bytes[i];

                // Commands
                if (b == 0x03)
                {
                    //The EndOfText command is a Null Command which can be used to flush any buffered text to the current window. All commands force a flush of any buffered text to the current window, so this command is only needed when no other command is pending.
                    if (DebugMode)
                    {
                        sb.Append("{EndOfText}");
                    }

                    FlushText(sb, state);
                }
                else if (b >= 0x80 && b <= 0x87)
                {
                    //SetCurrentWindow tells the caption decoder which window the following commands describe: SetWindowAttributes, SetPenAttributes, SetPenColor, SetPenLocation. If the window specified has not already been created with a DefineWindow command then
                    //SetCurrentWindow and the window property commands can be safely ignored.
                    var currentWindow = new CurrentWindow(lineIndex, b - 0x80);
                    state.Commands.Add(currentWindow);
                    if (DebugMode)
                    {
                        sb.Append("{SetCurrentWindow:" + currentWindow.Index + "}");
                    }
                }
                else if (b == 0x88)
                {
                    // ClearWindows clears all the windows specified in the 8 bit window bitmap.
                    var clearWindows = new ClearWindows(lineIndex, bytes, i + 1);
                    state.Commands.Add(clearWindows);
                    if (DebugMode)
                    {
                        sb.Append("{ClearWindows}");
                    }

                    i++;
                }
                else if (b == 0x89)
                {
                    // DisplayWindows displays all the windows specified in the 8 bit window bitmap.
                    var displayWindows = new DisplayWindows(lineIndex, bytes, i + 1);
                    state.Commands.Add(displayWindows);
                    if (DebugMode)
                    {
                        sb.Append("{DisplayWindows}");
                    }

                    i++;
                }
                else if (b == 0x8A)
                {
                    // HideWindows hides all the windows specified in the 8 bit window bitmap.
                    var hideWindows = new HideWindows(lineIndex, bytes, i + 1);
                    state.Commands.Add(hideWindows);
                    if (DebugMode)
                    {
                        sb.Append("{HideWindows}");
                    }

                    i++;
                }
                else if (b == 0x8B)
                {
                    // ToggleWindows hides all displayed windows, and displays all hidden windows specified in the 8 bit window bitmap.
                    var toggleWindows = new ToggleWindows(lineIndex, bytes, i + 1);
                    state.Commands.Add(toggleWindows);
                    if (DebugMode)
                    {
                        sb.Append("{ToggleWindows}");
                    }

                    i++;
                }
                else if (b == 0x8C)
                {
                    // DeleteWindows deletes all the windows specified in the 8 bit window bitmap.If the current window, as specified by the last SetCurrentWindow command, is deleted then the current window becomes undefined and the window attribute commands should have no effect until after the next SetCurrentWindow or DefineWindow command.
                    var deleteWindows = new DeleteWindows(lineIndex, bytes, i + 1);
                    state.Commands.Add(deleteWindows);
                    if (DebugMode)
                    {
                        sb.Append("{DeleteWindows}");
                    }

                    i++;
                }
                else if (b == 0x8D)
                {
                    // Delay suspends all processing of the current service, except for DelayCancel and Reset scanning.The period of suspension is set to by the one byte parameter.The parameter specifies the delay in tenths of a second, so the minimum delay is 0.1 seconds, and the maximum delay is 25.5 seconds.A zero second delay can safely be ignored in a decoder, but should not be emitted from an encoder.A delay should be cancelled if the caption decoder's input buffer becomes full, a DelayCancel or Reset is received, or the specified delay time elapses.
                    var delay = new Delay(lineIndex, bytes, i + 1);
                    state.Commands.Add(delay);
                    if (DebugMode)
                    {
                        sb.Append("{Delay:" + delay.Milliseconds + "ms}");
                    }

                    i++;
                }
                else if (b == 0x8E)
                {
                    // DelayCancel terminates any active delay and resumes normal command processing. DelayCancel should be scanned for during a Delay.
                    var delayCancel = new DelayCancel(lineIndex);
                    state.Commands.Add(delayCancel);
                    if (DebugMode)
                    {
                        sb.Append("{DelayCancel}");
                    }
                }
                else if (b == 0x8F)
                {
                    // Reset deletes all windows, cancels any active delay, and clears the buffer before the Reset command. Reset should be scanned for during a Delay.
                    var reset = new Reset(lineIndex);
                    state.Commands.Add(reset);
                    if (DebugMode)
                    {
                        sb.Append("{Reset}");
                    }
                }
                else if (b == 0x90)
                {
                    // The SetPenAttributes command specifies how certain attributes of subsequent characters are to be rendered in the current window, until the next SetPenAttributes command.
                    var penAttributes = new PenAttributes(lineIndex, bytes, i + 1);
                    state.Commands.Add(penAttributes);
                    if (DebugMode)
                    {
                        sb.Append("{SetPenAttributes:italic=" + penAttributes.Italics + "}");
                    }

                    i += 2;
                }
                else if (b == 0x91)
                {
                    // SetPenColor sets the foreground, background, and edge color for the subsequent characters. Color is specified with 6 bits, 2 for each of blue, green and red. The lowest order bits are for blue, the next two for green and the highest order bits represent red. Opacity is represented by two bits, they represent SOLID=0, FLASH=1, TRANSLUCENT=2, and TRANSPARENT=3. The edge color is the color of the outlined edges of the text, but the outline shares its opacity with the foreground, so the highest order bits of the third parameter byte should both be cleared.
                    var penColor = new PenColor(lineIndex, bytes, i + 1);
                    state.Commands.Add(penColor);
                    if (DebugMode)
                    {
                        sb.Append("{SetPenColor:color=r" + penColor.ForegroundColorRed + " g" + penColor.ForegroundColorGreen + " b" + penColor.ForegroundColorBlue + "}");
                    }

                    i += 3;
                }
                else if (b == 0x92)
                {
                    // SetPenLocation sets the location of for the next bit of appended text in the current window. It has two parameters, row and column. If a window is not locked (see Define Window) and the SMALL font is in effect the location can be outside the otherwise valid addresses.
                    var penLocation = new PenLocation(lineIndex, bytes, i + 1);
                    state.Commands.Add(penLocation);
                    if (DebugMode)
                    {
                        sb.Append("{SetPenLocation:" + penLocation.Row + "," + penLocation.Column + "}");
                    }

                    i += 2;
                }
                else if (b == 0x97)
                {
                    // SetWindowAttributes Sets the window attributes of the current window. Fill Color is specified with 6 bits, 2 for each of blue, green and red. The lowest order bits are for blue, the next two for green and the highest order bits represent red. Fill Opacity is represented by two bits, they represent SOLID=0, FLASH=1, TRANSLUCENT=2, and TRANSPARENT=3. The window's Border Color is specified the same way. However, the Border Type is split into two fields. They should be combined, with border type 01 representing the low order bits, and border type 2 the high order bit. Once combined the Border Type has 6 valid values: NONE=0, RAISED=1, DEPRESSED=2, UNIFORM=3, SHADOW_LEFT=4, and SHADOW_RIGHT=5.
                    var windowAttributes = new WindowAttributes(lineIndex, bytes, i + 1);
                    state.Commands.Add(windowAttributes);
                    if (DebugMode)
                    {
                        sb.Append("{SetWindowAttributes}");
                    }

                    i += 4;
                }
                else if (b >= 0x98 && b <= 0x9F)
                {
                    //DefineWindow0-7 creates one of the eight windows used by a caption decoder. This command should be sent periodically by a caption encoder even for pre-existing windows so that a newly tuned in caption decoder can begin displaying captions. When issued on a pre-existing window the pen style and window style can be left null, this tells the decoder not to change the current styles if they exist, and initialize both to style 1 if the window does not exist in its context
                    var window = new Window(lineIndex, bytes, i + 1);
                    state.Commands.Add(window);
                    if (DebugMode)
                    {
                        sb.Append("{DefineWindow}");
                    }

                    i += 6;
                }

                // Lookups
                else if (b == 0x10 && i < bytes.Length - 1)
                {
                    // ext 1
                    var b2 = bytes[i] << 8 + bytes[i + 1];
                    i++;

                    if (b2 >= 0x1000 && b2 <= 0x101F)
                    {
                        // CL Group: C2: ISO 8859 - Extended Miscellaneous Control Codes
                    }
                    else if (b2 >= 0x1020 && b2 <= 0x107F)
                    {
                        // GL Group: G2: Extended Control Code Set 1
                    }
                    else if (b2 >= 0x1080 && b2 <= 0x109F)
                    {
                        // CR Group: C3: Extended Control Code Set 2
                    }
                    else if (b2 >= 0x10A0 && b2 <= 0x10FF)
                    {
                        // GR Group: G3:  Future characters and icons
                    }
                }
                else if (b <= 0x1F)
                {
                    // CL Group: C0: Subset of ASCII Control Codes
                    sb.Append(SingleCharLookupTable[b]);

                    //TODO: ???
                    //if (b >= 0x10 && b <= 0x17)
                    //{
                    //    i++;
                    //}
                    //else if (b >= 0x18 && b <= 0x1F)
                    //{
                    //    i+=2;
                    //}
                }
                else if (b >= 0x20 && b <= 0x7F)
                {
                    // Modified version of ANSI X3.4 Printable Character Set(ASCII)
                    sb.Append(SingleCharLookupTable[b]);
                }
                else if (b >= 0x80 && b <= 0x9f)
                {
                    // CR Group: C1: Caption Control Codes
                    sb.Append(SingleCharLookupTable[b]);
                }
                else if (b >= 0xA0 && b <= 0xFF)
                {
                    // ISO 8859 - 1 Latin 1 Characters
                    sb.Append(SingleCharLookupTable[b]);
                }

                i++;
            }

            return(sb.ToString());
        }