Ejemplo n.º 1
0
        public MarqueeDisplay1300(LedPictureText pContent)
        {
            this.content = pContent;
            LedElement ledElement = this.content.Elements[0];

            System.Drawing.Size size = this.content.GetSize();
            this.nowLoopNum = 1;
            int num = 0;
            int num2;

            if (ledElement.PageCount >= 3)
            {
                num2 = 3;
            }
            else
            {
                num2 = ledElement.PageCount;
            }
            int  num3 = size.Width * num2;
            bool flag = false;
            int  num4 = pContent.EffectiveLength;

            if (num3 > pContent.EffectiveLength)
            {
                num3 = pContent.EffectiveLength;
            }
            if (pContent.EffectiveLength < size.Width)
            {
                if (pContent.EffectiveLength == 0)
                {
                    num3 = size.Width;
                    num4 = size.Width;
                }
                else
                {
                    num3 = (size.Width / pContent.EffectiveLength + 1) * num3;
                    num4 = pContent.EffectiveLength;
                }
                flag = true;
            }
            this.AllBit = new System.Drawing.Bitmap(num3, size.Height);
            System.Drawing.Graphics graphics = System.Drawing.Graphics.FromImage(this.AllBit);
            for (int i = 0; i < num2; i++)
            {
                System.Drawing.Bitmap bmpFromFile = LedGraphics.GetBmpFromFile(size, i, this.content.GetFileFullPath());
                if (flag)
                {
                    for (int j = 0; j < num3; j += num4)
                    {
                        graphics.DrawImage(bmpFromFile, new System.Drawing.Rectangle(j, 0, num4, size.Height), new System.Drawing.Rectangle(0, 0, num4, size.Height), System.Drawing.GraphicsUnit.Pixel);
                    }
                }
                else
                {
                    graphics.DrawImage(bmpFromFile, new System.Drawing.Point(num, 0));
                    num += bmpFromFile.Width;
                    bmpFromFile.Dispose();
                }
            }
        }
Ejemplo n.º 2
0
        private bool HasContentOverlength(LedPanel panel, ref string msg)
        {
            bool result = false;

            msg = string.Empty;
            foreach (LedItem current in panel.Items)
            {
                foreach (LedSubarea current2 in current.Subareas)
                {
                    foreach (LedContent current3 in current2.Contents)
                    {
                        if (current3.Type == LedContentType.TextPicture)
                        {
                            LedPictureText ledPictureText = current3 as LedPictureText;
                            if (ledPictureText.EffectsSetting.EntryMode > 2 && ledPictureText.EffectsSetting.EntryMode < 7 && ledPictureText.EffectiveLength > 65536)
                            {
                                switch (ledPictureText.PictureTextType)
                                {
                                case LedPictureTextType.Text:
                                case LedPictureTextType.MultilineText:
                                case LedPictureTextType.Table:
                                    result = true;
                                    msg    = formMain.ML.GetStr("Message_Data_Has_Exceeded_The_Maximum_Display_Range");
                                    break;
                                }
                            }
                        }
                    }
                }
            }
            return(result);
        }
Ejemplo n.º 3
0
        public MarqueeDisplay132(LedPictureText pContent)
        {
            this.content = pContent;
            LedElement ledElement = this.content.Elements[0];

            System.Drawing.Size size = this.content.GetSize();
            this.nowLoopNum   = 1;
            this.nowPositionF = 0f;
            int num = 0;
            int num2;

            if (ledElement.PageCount >= 3)
            {
                num2 = 3;
                ledElement.PageNumber = 3;
            }
            else
            {
                num2 = ledElement.PageCount;
                ledElement.PageNumber = ledElement.PageCount;
            }
            this.AllBit = new System.Drawing.Bitmap(size.Width, size.Height * num2);
            System.Drawing.Graphics graphics = System.Drawing.Graphics.FromImage(this.AllBit);
            for (int i = 0; i < num2; i++)
            {
                System.Drawing.Bitmap bmpFromFile = LedGraphics.GetBmpFromFile(size, i, this.content.GetFileFullPath());
                graphics.DrawImage(bmpFromFile, new System.Drawing.Point(0, num));
                num += bmpFromFile.Height;
                bmpFromFile.Dispose();
            }
            this.thisBitmap       = LedGraphics.GetBmpFromFile(size, 0, this.content.GetFileFullPath());
            ledElement.PageNumber = 1;
        }
Ejemplo n.º 4
0
        private static MarqueeDisplay getMarqueeDisplayByContent(LedPictureText pContent)
        {
            int num = (int)LedGlobal.EntryModeList[(int)pContent.EffectsSetting.EntryMode];

            if (pContent.PictureTextType == LedPictureTextType.Animation | pContent.PictureTextType == LedPictureTextType.GIF)
            {
                return(new MarqueeDisplayAnimation(pContent));
            }
            if (pContent.PictureTextType == LedPictureTextType.Text && num == 130)
            {
                return(new MarqueeDisplay1300(pContent));
            }
            if (num == 130)
            {
                return(new MarqueeDisplay130(pContent));
            }
            if (num == 131)
            {
                return(new MarqueeDisplay131(pContent));
            }
            if (num == 132)
            {
                return(new MarqueeDisplay132(pContent));
            }
            if (num == 133)
            {
                return(new MarqueeDisplay133(pContent));
            }
            return(new MarqueeDisplayTotal(pContent));
        }
Ejemplo n.º 5
0
 private void UpdateText()
 {
     if (this.dis == null)
     {
         this.content = (LedDText)this.ledSub.SelectedContent;
         this.dis     = LedSubareaDisplayHolder.getMarqueeDisplayByContent(this.content);
         this.edgeDis = new EdgeDisplay(this.ledSub.SelectedContent.Edge, this.ledSub);
     }
     System.Drawing.Bitmap @new = this.dis.getNew();
     if (@new == null)
     {
         this.dis     = LedSubareaDisplayHolder.getMarqueeDisplayByContent(this.content);
         this.edgeDis = new EdgeDisplay(this.ledSub.SelectedContent.Edge, this.ledSub);
         @new         = this.dis.getNew();
     }
     lock (@new)
     {
         if (this.content.Edge.Enabled)
         {
             System.Drawing.Bitmap new2 = this.edgeDis.GetNew(@new);
             formMain.ReleasePicture(this.pictureBox1, LedSubareaDisplayHolder.Griding(new2, formDisplay.zoon));
         }
         else
         {
             formMain.ReleasePicture(this.pictureBox1, LedSubareaDisplayHolder.Griding(@new, formDisplay.zoon));
         }
     }
 }
Ejemplo n.º 6
0
 public MarqueeDisplayAnimation(LedPictureText pContent)
 {
     this.content = pContent;
     if (this.content.Elements != null && this.content.Elements.Count > 0 && this.content.Elements[0].PageCount == 0)
     {
         return;
     }
     this.nowLoopNum = 0;
 }
Ejemplo n.º 7
0
		public bool CheckAnimationAndBackground(LedPanel _this_Panel)
		{
			bool result = false;
			for (int i = 0; i < _this_Panel.Items.Count; i++)
			{
				LedItem ledItem = _this_Panel.Items[i];
				if (ledItem.Background.Enabled)
				{
					result = true;
					break;
				}
				for (int j = 0; j < ledItem.Subareas.Count; j++)
				{
					LedSubarea ledSubarea = ledItem.Subareas[j];
					if (ledSubarea.Type == LedSubareaType.Animation)
					{
						result = true;
						break;
					}
					if (ledSubarea.Type == LedSubareaType.PictureText)
					{
						for (int k = 0; k < ledSubarea.Contents.Count; k++)
						{
							LedPictureText ledPictureText = (LedPictureText)ledSubarea.Contents[k];
							if (ledPictureText.PictureTextType == LedPictureTextType.Animation)
							{
								result = true;
								break;
							}
							if (ledPictureText.Background.Enabled)
							{
								result = true;
								break;
							}
						}
					}
					else if (ledSubarea.Type == LedSubareaType.Subtitle)
					{
						LedDText ledDText = (LedDText)ledSubarea.SelectedContent;
						if (ledDText.Background.Enabled)
						{
							result = true;
							break;
						}
					}
					else if (ledSubarea.SelectedContent.Background.Enabled)
					{
						result = true;
						break;
					}
				}
			}
			this.isAnimation = result;
			return result;
		}
Ejemplo n.º 8
0
		private void GetAnimationAndBackground(LedPanel _this_Panel)
		{
			for (int i = 0; i < _this_Panel.Items.Count; i++)
			{
				LedItem ledItem = _this_Panel.Items[i];
				if (ledItem.Background.Enabled)
				{
					this.MakeAnimation(new System.Drawing.Size(_this_Panel.Width, _this_Panel.Height), ledItem.Background);
				}
				for (int j = 0; j < ledItem.Subareas.Count; j++)
				{
					LedSubarea ledSubarea = ledItem.Subareas[j];
					if (ledSubarea.Type == LedSubareaType.Animation)
					{
						LedAnimation ledAnimation = (LedAnimation)ledSubarea.SelectedContent;
						this.MakeAnimation(ledAnimation);
						if (ledAnimation.Background.Enabled)
						{
							this.MakeAnimation(ledSubarea.Size, ledAnimation.Background);
						}
					}
					else if (ledSubarea.Type == LedSubareaType.PictureText)
					{
						for (int k = 0; k < ledSubarea.Contents.Count; k++)
						{
							LedPictureText ledPictureText = (LedPictureText)ledSubarea.Contents[k];
							if (ledPictureText.PictureTextType == LedPictureTextType.Animation)
							{
								this.MakeAnimation((LedAnimation)ledPictureText);
							}
							if (ledPictureText.Background.Enabled)
							{
								this.MakeAnimation(ledSubarea.Size, ledPictureText.Background);
							}
						}
					}
					else if (ledSubarea.Type == LedSubareaType.Subtitle)
					{
						LedDText ledDText = (LedDText)ledSubarea.SelectedContent;
						if (ledDText.Background.Enabled)
						{
							this.MakeAnimation(ledSubarea.Size, ledDText.Background);
						}
					}
					else if (ledSubarea.SelectedContent.Background.Enabled)
					{
						this.MakeAnimation(ledSubarea.Size, ledSubarea.SelectedContent.Background);
					}
				}
			}
		}
Ejemplo n.º 9
0
        public MarqueeDisplay131(LedPictureText pContent)
        {
            this.content = pContent;
            LedElement ledElement = this.content.Elements[0];

            System.Drawing.Size size = this.content.GetSize();
            this.pageCount  = ledElement.PageCount;
            this.nowLoopNum = 1;
            int num;

            if (this.pageCount >= 3)
            {
                num             = 3;
                this.pageNumber = 3;
            }
            else
            {
                num             = this.pageCount;
                this.pageNumber = this.pageCount;
            }
            int  num2 = size.Width * num;
            bool flag = false;

            if (num2 > pContent.EffectiveLength)
            {
                num2 = pContent.EffectiveLength;
            }
            if (pContent.EffectiveLength < size.Width)
            {
                num2 = (size.Width / pContent.EffectiveLength + 1) * num2;
                flag = true;
            }
            this.AllBit = new System.Drawing.Bitmap(num2, size.Height);
            System.Drawing.Graphics graphics = System.Drawing.Graphics.FromImage(this.AllBit);
            int num3 = size.Width * (num - 1);

            for (int i = 0; i < num; i++)
            {
                System.Drawing.Bitmap bmpFromFile = LedGraphics.GetBmpFromFile(size, this.pageCount - 1 - i, this.content.GetFileFullPath());
                if (i == 0)
                {
                    if (flag)
                    {
                        for (int j = 0; j < num2; j += pContent.EffectiveLength)
                        {
                            graphics.DrawImage(bmpFromFile, new System.Drawing.Rectangle(j, 0, pContent.EffectiveLength, size.Height), new System.Drawing.Rectangle(0, 0, pContent.EffectiveLength, size.Height), System.Drawing.GraphicsUnit.Pixel);
                        }
                    }
                    else
                    {
                        graphics.DrawImage(bmpFromFile, new System.Drawing.Point(num3, 0));
                    }
                }
                else
                {
                    graphics.DrawImage(bmpFromFile, new System.Drawing.Point(num3, 0));
                }
                num3 -= bmpFromFile.Width;
                bmpFromFile.Dispose();
            }
            this.nowPositionF = (float)this.AllBit.Width;
        }
Ejemplo n.º 10
0
		public bool GenerateData(LedPanel panel, ref Process process)
		{
			bool result = false;
			try
			{
				for (int i = 0; i < panel.Items.Count; i++)
				{
					for (int j = 0; j < panel.Items[i].Subareas.Count; j++)
					{
						if (panel.Items[i].Subareas[j].Type == LedSubareaType.Subtitle)
						{
							LedDText ledDText = (LedDText)panel.Items[i].Subareas[j].SelectedContent;
							if (ledDText.DoNeedDrawingFull)
							{
								ledDText.DrawMode = LedDrawMode.Full;
								ledDText.Draw();
								ledDText.DrawMode = LedDrawMode.Part;
							}
						}
						else if (panel.Items[i].Subareas[j].Type == LedSubareaType.PictureText)
						{
							LedSubarea ledSubarea = panel.Items[i].Subareas[j];
							for (int k = 0; k < ledSubarea.Contents.Count; k++)
							{
								LedPictureText ledPictureText = (LedPictureText)ledSubarea.Contents[k];
								if (ledPictureText.DoNeedDrawingFull || (ledPictureText.LastDrawn != null && ledPictureText.GetSize() != ledPictureText.LastDrawn.Size))
								{
									ledPictureText.DrawMode = LedDrawMode.Full;
									ledPictureText.Draw();
									ledPictureText.DrawMode = LedDrawMode.Part;
								}
							}
						}
					}
				}
				if (this.isAnimation)
				{
					this.GetAnimationAndBackground(panel);
				}
				process = new Process();
				if (panel.IsLSeries())
				{
					process.PanelBytes = panel.ToLBytes();
					process.ItemTimerLBytes = panel.ToItemTimerLByte();
					process.ItemStartLBytes = panel.ToItemStartLBytes();
					process.ItemLBytes = panel.ToItemLBytes();
				}
				else
				{
					process.PanelBytes = panel.ToBytes();
					process.BmpDataBytes = panel.ToItemBmpDataBytes();
					process.ItemBytes = panel.ToItemBytes();
				}
				result = true;
			}
			catch
			{
				process = null;
				result = false;
			}
			return result;
		}
Ejemplo n.º 11
0
 private void StartRedraw()
 {
     do
     {
         this.DrawNum = 0;
         int num = 0;
         if (this.subarea.SelectedContent != null)
         {
             num = this.subarea.SelectedContent.GetActualWidth();
         }
         if (num > 0 && this.subarea.Width < num)
         {
             this.subarea.Width = num;
         }
         int num2 = 0;
         if (this.subarea.ParentItem != null && this.subarea.ParentItem.Edge != null)
         {
             num2 = (this.subarea.ParentItem.Edge.Enabled ? this.subarea.ParentItem.Edge.Height : 0);
         }
         if (this.subarea.SelectedContent != null && this.subarea.SelectedContent.Edge != null && this.subarea.SelectedContent.Edge.Enabled)
         {
             int arg_E1_0 = this.subarea.SelectedContent.Edge.Height;
         }
         if (this.subarea.Width > this.subarea.ParentItem.ParentPanel.Width - num2 * 2)
         {
             this.subarea.Width = this.subarea.ParentItem.ParentPanel.Width - num2 * 2;
         }
         if (this.subarea.Width + this.subarea.X > this.subarea.ParentItem.ParentPanel.Width - num2 * 2)
         {
             this.subarea.X = this.subarea.ParentItem.ParentPanel.Width - num2 * 2 - this.subarea.Width;
         }
         this.ResetHolderPosition();
         try
         {
             this.subarea.Draw();
         }
         catch
         {
         }
     }while (this.DrawNum > 0);
     this.DrawFinished           = true;
     this.subarea.LastScaleDrawn = LedGraphics.ScaleAndGrid(this.subarea.LastDrawn, formMain.ledsys.SelectedPanel.Zoom);
     if (this.subarea.LastScaleDrawn != null && this.subarea.LastScaleDrawn.PixelFormat != System.Drawing.Imaging.PixelFormat.Undefined)
     {
         System.Drawing.Bitmap bitmap = (System.Drawing.Bitmap) this.subarea.LastScaleDrawn.Clone();
         if (this.isActivated)
         {
             this.DrawControlPoint(bitmap);
         }
         formMain.ReleasePicture(this.picSubarea, bitmap);
         bitmap.Dispose();
     }
     if (this.subarea.Type == LedSubareaType.Animation)
     {
         LedAnimation ledAnimation = (LedAnimation)this.subarea.SelectedContent;
         ledAnimation.Changed = true;
         return;
     }
     if (this.subarea.Type == LedSubareaType.PictureText && this.subarea.SelectedContent != null)
     {
         LedPictureText ledPictureText = (LedPictureText)this.subarea.SelectedContent;
         if (ledPictureText.PictureTextType == LedPictureTextType.Animation)
         {
             ((LedAnimation)ledPictureText).Changed = true;
         }
     }
 }
Ejemplo n.º 12
0
 public MarqueeDisplayTotal(LedPictureText pContent)
 {
     this.content = pContent;
 }
Ejemplo n.º 13
0
 private void timer_Marquee_Tick(object sender, EventArgs e)
 {
     if (!this.isAnimation && this.ledSub.Contents.Count == 0)
     {
         return;
     }
     if (this.dis == null)
     {
         this.nowMarqueeIndex = 0;
         if (this.isAnimation)
         {
             this.content = this.ledAnimation;
         }
         else
         {
             this.content = (LedPictureText)this.ledSub.Contents[0];
         }
         this.dis = LedSubareaDisplayHolder.getMarqueeDisplayByContent(this.content);
         if (this.ledSub != null && this.ledSub.Contents.Count > 1)
         {
             this.dis.NeedChangeContent = true;
         }
         this.edgeDis = new EdgeDisplay(this.content.Edge, this.ledSub);
     }
     System.Drawing.Bitmap @new = this.dis.getNew();
     if (@new == null)
     {
         if (this.isAnimation)
         {
             this.content = this.ledAnimation;
         }
         else
         {
             this.nowMarqueeIndex++;
             if (this.nowMarqueeIndex == this.ledSub.Contents.Count)
             {
                 this.nowMarqueeIndex = 0;
             }
             this.content = (LedPictureText)this.ledSub.Contents[this.nowMarqueeIndex];
         }
         this.dis = LedSubareaDisplayHolder.getMarqueeDisplayByContent(this.content);
         if (this.ledSub != null && this.ledSub.Contents.Count > 1)
         {
             this.dis.NeedChangeContent = true;
         }
         this.edgeDis = new EdgeDisplay(this.content.Edge, this.ledSub);
         @new         = this.dis.getNew();
     }
     if (@new != null)
     {
         lock (@new)
         {
             if (this.content.Edge.Enabled)
             {
                 System.Drawing.Bitmap new2 = this.edgeDis.GetNew(@new);
                 formMain.ReleasePicture(this.pictureBox1, LedSubareaDisplayHolder.Griding(new2, formDisplay.zoon));
             }
             else
             {
                 System.Drawing.Bitmap pBit = LedSubareaDisplayHolder.Griding(@new, formDisplay.zoon);
                 formMain.ReleasePicture(this.pictureBox1, pBit);
             }
         }
     }
 }