コード例 #1
0
        public override View GetSampleContent(Context con)
        {
            LinearLayout linear = new LinearLayout(con);

            linear.SetBackgroundColor(Color.White);
            linear.Orientation = Orientation.Vertical;
            linear.SetPadding(10, 10, 10, 10);

            TextView text1 = new TextView(con);

            text1.TextSize = 16;
            text1.SetTextColor(Color.ParseColor("#262626"));
            text1.Typeface = Typeface.DefaultBold;
            text1.Text     = "Allowed Characters";
            text1.SetPadding(5, 10, 10, 5);
            linear.AddView(text1);

            TextView text2 = new TextView(con);

            text2.TextSize = 14;
            text2.SetTextColor(Color.ParseColor("#3F3F3F"));
            text2.Text = "ASCII values from 0 to 95\nNUL SOH STX ETX EOT ENQ ACK BEL BS HT LF VT FF CR SO SI DLE DC1 DC2 DC3 DC4 NAK SYN ETB CAN EM SUB ESC FS GS RS US SPACE ! \" # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \\ ]^ _";
            text2.SetPadding(5, 5, 5, 5);
            LinearLayout text2Layout = new LinearLayout(con);

            LinearLayout.LayoutParams parms = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MatchParent, LinearLayout.LayoutParams.WrapContent);
            text2Layout.LayoutParameters = parms;
            text2Layout.AddView(text2);
            linear.AddView(text2Layout);

            LinearLayout barcodeLayout = new LinearLayout(con);

            barcodeLayout.SetPadding(0, 10, 0, 5);
            LinearLayout.LayoutParams parms1 = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MatchParent, LinearLayout.LayoutParams.WrapContent);
            barcodeLayout.LayoutParameters = parms1;

            barcode      = new SfBarcode(con);
            barcode.Text = "ACL32 SF-D8";
            Typeface fontFamily = Typeface.Create("helvetica", TypefaceStyle.Bold);

            barcode.TextFont = fontFamily;
            barcode.SetBackgroundColor(Color.ParseColor("#F2F2F2"));
            barcode.Symbology = BarcodeSymbolType.Code128A;
            barcode.TextSize  = 20;

            Code128ASettings setting = new Code128ASettings();

            setting.BarHeight         = 120;
            setting.NarrowBarWidth    = 3;
            barcode.SymbologySettings = setting;
            barcodeLayout.AddView(barcode);
            linear.AddView(barcodeLayout);

            return(linear);
        }
コード例 #2
0
		public override View GetSampleContent (Context con)
		{
            LinearLayout linear = new LinearLayout(con);
            linear.SetBackgroundColor(Color.White);
            linear.Orientation = Orientation.Vertical;
            linear.SetPadding(10, 10, 10, 10);

            TextView text1 = new TextView(con);
            text1.TextSize = 16;
            text1.SetTextColor(Color.ParseColor("#262626"));
            text1.Typeface = Typeface.DefaultBold;
            text1.Text = "Allowed Characters";
            text1.SetPadding(5, 10, 10, 5);
            linear.AddView(text1);

            TextView text2 = new TextView(con);
            text2.TextSize = 14;
            text2.SetTextColor(Color.ParseColor("#3F3F3F"));
            text2.Text = "ASCII values from 0 to 95\nNUL SOH STX ETX EOT ENQ ACK BEL BS HT LF VT FF CR SO SI DLE DC1 DC2 DC3 DC4 NAK SYN ETB CAN EM SUB ESC FS GS RS US SPACE ! \" # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \\ ]^ _";
            text2.SetPadding(5, 5, 5, 5);
            LinearLayout text2Layout = new LinearLayout(con);
            LinearLayout.LayoutParams parms = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MatchParent, LinearLayout.LayoutParams.WrapContent);
            text2Layout.LayoutParameters = parms;
            text2Layout.AddView(text2);
            linear.AddView(text2Layout);

            LinearLayout barcodeLayout = new LinearLayout(con);
            barcodeLayout.SetPadding(0, 10, 0, 5);
            LinearLayout.LayoutParams parms1 = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MatchParent, LinearLayout.LayoutParams.WrapContent);
            barcodeLayout.LayoutParameters = parms1;

            barcode = new SfBarcode(con);
            barcode.Text = "ACL32 SF-D8";
            Typeface fontFamily = Typeface.Create("helvetica", TypefaceStyle.Bold);
            barcode.TextFont = fontFamily;
            barcode.SetBackgroundColor(Color.ParseColor("#F2F2F2"));
            barcode.Symbology = BarcodeSymbolType.Code128A;
            barcode.TextSize = 20;

            Code128ASettings setting = new Code128ASettings();
            setting.BarHeight = 120;
            setting.NarrowBarWidth = 3;
            barcode.SymbologySettings = setting;
            barcodeLayout.AddView(barcode);
            linear.AddView(barcodeLayout);

            return linear;
		}
コード例 #3
0
        //Loading Barcode Symbol Types
        void LoadBarcode(ref SfBarcode barcode, BarcodeSymbolType symbolType, string text)
        {
            if (barcode == null)
            {
                barcode = new SfBarcode();
            }
            barcode.VerticalOptions   = LayoutOptions.FillAndExpand;
            barcode.HorizontalOptions = LayoutOptions.FillAndExpand;
            barcode.BackgroundColor   = Color.FromRgb(234, 234, 234);
            barcode.Text      = text;
            barcode.TextFont  = Font.SystemFontOfSize(fontSize);
            barcode.Symbology = symbolType;

            if (symbolType == BarcodeSymbolType.QRCode)
            {
                QRBarcodeSettings qr = new QRBarcodeSettings()
                {
                    XDimension = xDimension,
                };
                barcode.SymbologySettings = qr;
            }
            else if (symbolType == BarcodeSymbolType.DataMatrix)
            {
                DataMatrixSettings dm = new DataMatrixSettings()
                {
                    XDimension = xDimension
                };
                barcode.SymbologySettings = dm;
            }
            else if (symbolType == BarcodeSymbolType.Code32)
            {
                Code32Settings c32 = new Code32Settings();
                barcode.SymbologySettings = c32;
            }
            else if (symbolType == BarcodeSymbolType.Code39)
            {
                Code39Settings c39 = new Code39Settings();
                barcode.SymbologySettings = c39;
            }
            else if (symbolType == BarcodeSymbolType.Code39Extended)
            {
                Code39ExtendedSettings c39e = new Code39ExtendedSettings();
                barcode.SymbologySettings = c39e;
            }
            else if (symbolType == BarcodeSymbolType.Code93)
            {
                Code93Settings c93 = new Code93Settings();
                barcode.SymbologySettings = c93;
            }
            else if (symbolType == BarcodeSymbolType.Code93Extended)
            {
                Code93ExtendedSettings c93e = new Code93ExtendedSettings();
                barcode.SymbologySettings = c93e;
            }
            else if (symbolType == BarcodeSymbolType.Code128C)
            {
                Code128CSettings c128c = new Code128CSettings();
                barcode.SymbologySettings = c128c;
            }
            else if (symbolType == BarcodeSymbolType.Code128A)
            {
                Code128ASettings c128a = new Code128ASettings();
                barcode.SymbologySettings = c128a;
            }
            else if (symbolType == BarcodeSymbolType.Code128B)
            {
                Code128BSettings c128b = new Code128BSettings();
                barcode.SymbologySettings = c128b;
            }
            else if (symbolType == BarcodeSymbolType.Code11)
            {
                Code11Settings c11 = new Code11Settings();
                barcode.SymbologySettings = c11;
            }
            else
            {
                CodaBarSettings coda = new CodaBarSettings();
                barcode.SymbologySettings = coda;
            }
        }
コード例 #4
0
        void LoadBarcode(ref SfBarcode barcode, BarcodeSymbolType symbolType, string text)
        {
            if (barcode == null)
                barcode = new SfBarcode();
            barcode.VerticalOptions = LayoutOptions.FillAndExpand;
            barcode.HorizontalOptions = LayoutOptions.FillAndExpand;
            barcode.BackgroundColor = Color.FromRgb(234, 234, 234);
            barcode.Text = text;
            barcode.TextFont = Font.SystemFontOfSize(fontSize);
            barcode.Symbology = symbolType;

            if (symbolType == BarcodeSymbolType.QRCode)
            {
                QRBarcodeSettings qr = new QRBarcodeSettings() { XDimension = xDimension, };
                barcode.SymbologySettings = qr;
            }
            else if (symbolType == BarcodeSymbolType.DataMatrix)
            {
                DataMatrixSettings dm = new DataMatrixSettings() { XDimension = xDimension };
                barcode.SymbologySettings = dm;
            }
            else if (symbolType == BarcodeSymbolType.Code32)
            {
                Code32Settings c32 = new Code32Settings();
                barcode.SymbologySettings = c32;
            }
            else if (symbolType == BarcodeSymbolType.Code39)
            {
                Code39Settings c39 = new Code39Settings();
                barcode.SymbologySettings = c39;
            }
            else if (symbolType == BarcodeSymbolType.Code39Extended)
            {
                Code39ExtendedSettings c39e = new Code39ExtendedSettings();
                barcode.SymbologySettings = c39e;
            }
            else if (symbolType == BarcodeSymbolType.Code93)
            {
                Code93Settings c93 = new Code93Settings();
                barcode.SymbologySettings = c93;
            }
            else if (symbolType == BarcodeSymbolType.Code93Extended)
            {
                Code93ExtendedSettings c93e = new Code93ExtendedSettings();
                barcode.SymbologySettings = c93e;
            }
            else if (symbolType == BarcodeSymbolType.Code128C)
            {
                Code128CSettings c128c = new Code128CSettings();
                barcode.SymbologySettings = c128c;
            }
            else if (symbolType == BarcodeSymbolType.Code128A)
            {
                Code128ASettings c128a = new Code128ASettings();
                barcode.SymbologySettings = c128a;
            }
            else if (symbolType == BarcodeSymbolType.Code128B)
            {
                Code128BSettings c128b = new Code128BSettings();
                barcode.SymbologySettings = c128b;
            }
            else if (symbolType == BarcodeSymbolType.Code11)
            {
                Code11Settings c11 = new Code11Settings();
                barcode.SymbologySettings = c11;
            }
            else
            {
                CodaBarSettings coda = new CodaBarSettings();
                barcode.SymbologySettings = coda;
            }
        }