Example #1
0
        public static LineParameters Convert(IExportContainer container, ref LineParameters origin)
        {
            LineParameters instance = origin;

            instance.WidthCurve = origin.WidthCurve.Convert(container);
            if (LineParameters.HasShadowBias(container.ExportVersion))
            {
                instance.ShadowBias = GetShadowBias(container, ref origin);
            }
            return(instance);
        }
Example #2
0
 private static LineParameters GetParameters(IExportContainer container, TrailRenderer origin)
 {
     if (TrailRenderer.HasParameters(container.Version))
     {
         return(origin.Parameters.Convert(container));
     }
     else
     {
         LineParameters instance = new LineParameters(container.ExportVersion);
         instance.WidthCurve    = origin.Parameters.WidthCurve.Convert(container);
         instance.ColorGradient = origin.Colors.GenerateGragient(container);
         return(instance);
     }
 }
Example #3
0
        //adding a bitmap
        public void AddLine(string type, string alignment, string offsetx, string linespace, string imagebase64)
        {
            LineParameters lineparams = new LineParameters();
            lineparams.Type = "image";
            lineparams.Alignment = Convert.ToInt16(alignment);

            lineparams.LineSpace = Convert.ToInt16(linespace);
            lineparams.base64Image = imagebase64;

            Byte[] bitmapData = Convert.FromBase64String(imagebase64);
            System.IO.MemoryStream streamBitmap = new System.IO.MemoryStream(bitmapData);

            BitmapImage bi = new BitmapImage();
            bi.BeginInit();
            bi.StreamSource = streamBitmap;
            bi.EndInit();

            lineparams.BitImage = bi;

            TicketLength += (int)bi.Height;

            Lines.Add(lineparams);
        }
Example #4
0
 //Add Empty lineparameters
 public void AddLine(string type)
 {
     LineParameters lineparams = new LineParameters();
     lineparams.Type = type;
     Lines.Add(lineparams);
 }
Example #5
0
        //Inserting since printers max linespace is 255 dots, over 255 we need a new linebreak.
        public void InsertLineBreak(string type, int index,int space)
        {
            LineParameters lineparams = new LineParameters();
            lineparams.Type = type;
            lineparams.Space = space;

            Lines.Insert(index, lineparams);
        }
Example #6
0
        //add Queuenumber
        public void AddLine(string type,string font, string alignment,string size, string bold, string underline,string characters)
        {
            LineParameters lineparams = new LineParameters();

            lineparams.Type = type;
            lineparams.Size = Convert.ToInt16(size);
            lineparams.Alignment = Convert.ToInt16(alignment);
            lineparams.Font = font;
            lineparams.Bold = Convert.ToInt16(bold);
            lineparams.Underline = Convert.ToInt16(underline);

            lineparams.Characters = characters;

            Lines.Add(lineparams);
        }
Example #7
0
        //add Textline
        public void AddLine(string type, string width, string height, string bold, string underline, string alignment, string offsetx, string linespace, string characterspace, string characters)
        {
            LineParameters lineparams = new LineParameters();

            lineparams.Type = type;

            lineparams.Width = Convert.ToInt16(width);
            lineparams.Height = Convert.ToInt16(height);
            lineparams.Bold = Convert.ToInt16(bold);
            lineparams.Underline = Convert.ToInt16(underline);

            lineparams.Alignment = Convert.ToInt16(alignment);
            lineparams.OffsetX = Convert.ToInt16(offsetx);
            lineparams.LineSpace = Convert.ToInt16(linespace);
            lineparams.CharacterSpace = Convert.ToInt16(characterspace);

            lineparams.Characters = characters;

            TicketLength += 24;

            Lines.Add(lineparams);
        }
Example #8
0
 //adding linebreaks that will make up for the space between elements vertically.
 public void AddLine(string type,string space)
 {
     LineParameters lineparams = new LineParameters();
     lineparams.Type = type;
     lineparams.Space = Convert.ToInt16(space);
     TicketLength += lineparams.Space*(24);
     Lines.Add(lineparams);
 }
Example #9
0
 private static float GetShadowBias(IExportContainer container, ref LineParameters origin)
 {
     return(LineParameters.HasShadowBias(container.Version) ? origin.ShadowBias : 0.5f);
 }
Example #10
0
 private bool DrawLine(double x1, double x2, double formerY, double y, Brush color, IFunction function)
 {
     LineParameters lineparams = new LineParameters(x1, x2, formerY, y, color, function);
     BoolWrapper result = this.m_Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Send, m_DrawLine, lineparams) as BoolWrapper;
     return (result != null) ? result.BoolValue : false;
 }