public EdgeDisplay(LedEdge edge, LedSubarea pSub) { this.ledEdge = edge; this.ledSub = pSub; this.subSize = pSub.Size; this.circular = (this.subSize.Width + this.subSize.Height) * 2; this.circularCount = 0m; lock (LedGlobal.LedEdgeList[edge.Index]) { if (this.ledEdge.Enabled) { this.AlphaBitmap = new System.Drawing.Bitmap((this.subSize.Width + this.subSize.Height) * 2, edge.Height); this.EdgeBitmap = new System.Drawing.Bitmap((this.subSize.Width + this.subSize.Height) * 2, edge.Height); System.Drawing.Graphics graphics = System.Drawing.Graphics.FromImage(this.EdgeBitmap); System.Drawing.TextureBrush brush = new System.Drawing.TextureBrush(LedGlobal.LedEdgeList[edge.Index]); graphics.FillRectangle(brush, new System.Drawing.Rectangle(0, 0, this.EdgeBitmap.Width, this.EdgeBitmap.Height)); if (this.ledEdge.Mode != LedEdgeMode.Clockwise && this.ledEdge.Mode == LedEdgeMode.CounterClockwise) { this.EdgeBitmap = this.SetCornerAlpha(this.EdgeBitmap); } this.StaticBitmap = new System.Drawing.Bitmap(this.subSize.Width, this.subSize.Height); System.Drawing.Graphics graphics2 = System.Drawing.Graphics.FromImage(this.StaticBitmap); graphics2.DrawImage(this.EdgeBitmap, new System.Drawing.Point(0, 0)); graphics2.TranslateTransform(0f, 0f); graphics2.RotateTransform(90f); graphics2.DrawImage(this.EdgeBitmap, new System.Drawing.Rectangle(0, -this.subSize.Width, this.subSize.Height, this.ledEdge.Height), new System.Drawing.Rectangle(this.subSize.Width, -1, this.subSize.Height, this.ledEdge.Height), System.Drawing.GraphicsUnit.Pixel); graphics2.DrawImage(this.EdgeBitmap, new System.Drawing.Rectangle(0, -this.subSize.Width, this.subSize.Height, this.ledEdge.Height), new System.Drawing.Rectangle(this.subSize.Width, 0, this.subSize.Height, this.ledEdge.Height), System.Drawing.GraphicsUnit.Pixel); graphics2.RotateTransform(90f); graphics2.DrawImage(this.EdgeBitmap, new System.Drawing.Rectangle(-this.subSize.Width, -this.subSize.Height, this.subSize.Width, this.ledEdge.Height), new System.Drawing.Rectangle(this.subSize.Width + this.subSize.Height, -1, this.subSize.Width, this.ledEdge.Height), System.Drawing.GraphicsUnit.Pixel); graphics2.RotateTransform(90f); graphics2.DrawImage(this.EdgeBitmap, new System.Drawing.Rectangle(-this.subSize.Height, 0, this.subSize.Height, this.ledEdge.Height), new System.Drawing.Rectangle(this.subSize.Width * 2 + this.subSize.Height, 0, this.subSize.Height, this.ledEdge.Height), System.Drawing.GraphicsUnit.Pixel); } } }
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; }
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); } } } }
public LedSubareaHolder(LedSubarea pSubarea) { this.InitializeComponent(); this.subarea = pSubarea; this.lblLocation.Text = string.Empty; this.lblLocation.Visible = false; this.lblSize.Text = string.Empty; this.lblSize.Visible = false; this.moveType = LedSubareaMoveType.All; this.nowZoom = formMain.Ledsys.SelectedPanel.Zoom; this.maxWidth = (int)(formMain.Ledsys.SelectedPanel.Width * this.nowZoom); this.maxHeight = (int)(formMain.Ledsys.SelectedPanel.Height * this.nowZoom); this.ChangeZoom(); }
public LedSubareaDisplayHolder(LedSubarea pSubarea) { this.InitializeComponent(); this.ledSub = pSubarea; this.ledSub.LoadFromFile(); if (pSubarea.Type == LedSubareaType.Subtitle) { this.isMarquee = true; LedDText arg_39_0 = (LedDText)pSubarea.SelectedContent; this.timer_Text.Start(); } else if (pSubarea.Type == LedSubareaType.PictureText) { this.isMarquee = true; this.timer_Marquee.Start(); } else if (pSubarea.Type == LedSubareaType.Animation) { this.isMarquee = true; this.isAnimation = true; this.ledAnimation = (LedAnimation)pSubarea.SelectedContent; this.timer_Marquee.Start(); } else { pSubarea.SelectedContent.LastDrawn = null; this.isMarquee = false; this.timer_Draw.Interval = 1000; this.timer_Draw.Start(); } if (pSubarea.SelectedContent != null && pSubarea.SelectedContent.Edge.Enabled && !this.isMarquee) { this.edgeDis = new EdgeDisplay(pSubarea.SelectedContent.Edge, pSubarea); this.timer_edge.Start(); } }
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; }