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; }
public void DrawBackground() { if (this.subarea.LastDrawn != null && this.subarea.LastDrawn.PixelFormat != System.Drawing.Imaging.PixelFormat.Undefined) { System.Drawing.Bitmap bitmap = LedGraphics.ScaleAndGrid(this.subarea.LastDrawn, formMain.ledsys.SelectedPanel.Zoom); if (this.isActivated) { this.DrawControlPoint(bitmap); } formMain.ReleasePicture(this.picSubarea, bitmap); bitmap.Dispose(); return; } System.Drawing.Bitmap bitmap2 = new System.Drawing.Bitmap(base.Width, base.Height); System.Drawing.Graphics graphics = System.Drawing.Graphics.FromImage(bitmap2); graphics.FillRectangle(new System.Drawing.SolidBrush(System.Drawing.Color.Black), 0, 0, bitmap2.Width, bitmap2.Height); if (this.nowZoom < 3m) { formMain.ReleasePicture(this.picSubarea, bitmap2); return; } int num = (int)this.nowZoom; System.Drawing.Pen pen = new System.Drawing.Pen(System.Drawing.Color.Gray); for (int i = 0; i < base.Width; i += num) { graphics.DrawLine(pen, i, 0, i, base.Size.Height); } for (int i = 0; i < base.Height; i += num) { graphics.DrawLine(pen, 0, i, base.Size.Width, i); } formMain.ReleasePicture(this.picSubarea, bitmap2); }
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(); } } }
public override System.Drawing.Bitmap getNew() { LedElement arg_11_0 = this.content.Elements[0]; System.Drawing.Size size = this.content.GetSize(); int width = size.Width; int height = size.Height; System.Drawing.Bitmap bitmap = new System.Drawing.Bitmap(width, height); System.Drawing.Graphics graphics = System.Drawing.Graphics.FromImage(bitmap); this.nowPosition = (int)this.nowPositionF; try { if (this.nowPosition + width <= 0) { this.nowPosition = 0; this.nowPositionF = 0f; this.nowLoopNum++; this.nowPositionF = (float)this.AllBit.Width; if (this.nowLoopNum > this.content.EffectsSetting.LoopCount) { return(null); } } if (this.nowPosition < 0 && this.nowLoopNum < this.content.EffectsSetting.LoopCount) { graphics.DrawImage(this.AllBit, new System.Drawing.Rectangle(0, 0, width, height), new System.Drawing.Rectangle(this.AllBit.Width + this.nowPosition, 0, width, height), System.Drawing.GraphicsUnit.Pixel); } if (this.nowPosition < 0) { graphics.DrawImage(this.AllBit, new System.Drawing.Rectangle(0, 0, Math.Abs(this.nowPosition), bitmap.Height), new System.Drawing.Rectangle(this.AllBit.Width + this.nowPosition, 0, Math.Abs(this.nowPosition), height), System.Drawing.GraphicsUnit.Pixel); } graphics.DrawImage(this.AllBit, new System.Drawing.Rectangle(0, 0, bitmap.Width, bitmap.Height), new System.Drawing.Rectangle(this.nowPosition, 0, width, height), System.Drawing.GraphicsUnit.Pixel); if (this.positionMark > (float)(size.Width * 2) && this.pageNumber < this.pageCount) { this.nowPositionF += (float)size.Width; this.positionMark -= (float)size.Width; System.Drawing.Bitmap bitmap2 = new System.Drawing.Bitmap(size.Width * 2, size.Height); System.Drawing.Graphics graphics2 = System.Drawing.Graphics.FromImage(bitmap2); graphics2.DrawImage(this.AllBit, new System.Drawing.Point(0, 0)); graphics2.Dispose(); graphics2 = System.Drawing.Graphics.FromImage(this.AllBit); graphics2.DrawImage(bitmap2, new System.Drawing.Point(size.Width, 0)); bitmap2.Dispose(); bitmap2 = LedGraphics.GetBmpFromFile(size, this.pageCount - this.pageNumber - 1, this.content.GetFileFullPath()); this.pageNumber++; graphics2.DrawImage(bitmap2, new System.Drawing.Point(0, 0)); graphics2.Dispose(); } this.nowPositionF -= MarqueeDisplay.speedEntryBase / (float)this.content.EffectsSetting.EntrySpeed; this.positionMark += MarqueeDisplay.speedEntryBase / (float)this.content.EffectsSetting.EntrySpeed; } catch { } return(bitmap); }
public string GetMovieString() { System.Drawing.Font font = this.animation.EAnimation.Font.GetFont(); this.PageCount = 0; string text = ""; System.Drawing.Bitmap image = new System.Drawing.Bitmap(10, 10); System.Drawing.Graphics.FromImage(image); if (this.animation.EAnimation.Text == "") { this.animation.EAnimation.Text = " "; } int num = this.animation.EAnimation.Text.Length; int num2 = 0; if (num <= 0) { return(text); } int i = 1; while (i <= num) { if (LedGraphics.GetStringToBitmapSize(this.animation.EAnimation.Text.Substring(num2, i), font).Width + (i - 1) * this.finalSpace > this.displaySize.Width) { if (i == 1) { i = 1; } else { i--; } if (num == i) { text += this.animation.EAnimation.Text.Substring(num2, i); this.PageCount++; } else { text = text + this.animation.EAnimation.Text.Substring(num2, i) + "^"; this.PageCount++; } num -= i; num2 += i; } else { i++; } } text += this.animation.EAnimation.Text.Substring(num2, num); this.PageCount++; return(text); }
public override System.Drawing.Bitmap getNew() { if (this.animationNowIndex >= this.content.Elements[0].PageCount) { this.nowLoopNum++; this.animationNowIndex = 0; } if (this.nowLoopNum > this.content.EffectsSetting.LoopCount) { return(null); } System.Drawing.Bitmap bmpFromFile = LedGraphics.GetBmpFromFile(this.content.GetSize(), this.animationNowIndex, this.content.GetFileFullPath()); this.animationNowIndex++; return(bmpFromFile); }
public override System.Drawing.Bitmap getNew() { LedElement ledElement = this.content.Elements[0]; System.Drawing.Size size = this.content.GetSize(); int width = size.Width; int height = size.Height; System.Drawing.Bitmap bitmap = new System.Drawing.Bitmap(width, height); System.Drawing.Graphics graphics = System.Drawing.Graphics.FromImage(bitmap); int num = (int)this.nowPositionF; graphics.DrawImage(this.thisBitmap, new System.Drawing.Point(0, height - num)); if (num < height && this.previousBitmap != null) { graphics.DrawImage(this.previousBitmap, new System.Drawing.Point(0, -(height - (height - num)))); } this.nowPositionF += MarqueeDisplay.speedEntryBase / (float)this.content.EffectsSetting.EntrySpeed; if (this.nowPositionF >= (float)height) { this.nowPositionF -= (float)height; if (this.previousBitmap != null) { this.previousBitmap.Dispose(); } this.previousBitmap = this.thisBitmap; this.thisBitmap = LedGraphics.GetBmpFromFile(size, ledElement.PageNumber, this.content.GetFileFullPath()); ledElement.PageNumber++; if (ledElement.PageNumber >= ledElement.PageCount) { ledElement.PageNumber = 0; System.Drawing.Bitmap image = new System.Drawing.Bitmap(width, height); System.Drawing.Bitmap image2 = new System.Drawing.Bitmap(width, height); int num2 = this.content.EffectiveLength % height; System.Drawing.Graphics graphics2 = System.Drawing.Graphics.FromImage(image2); graphics2.DrawImage(this.thisBitmap, new System.Drawing.Point(0, height - num2)); graphics2.DrawImage(this.previousBitmap, new System.Drawing.Point(0, -num2)); graphics2 = System.Drawing.Graphics.FromImage(image); graphics2.DrawImage(this.previousBitmap, new System.Drawing.Point(0, height - num2)); this.previousBitmap.Dispose(); this.thisBitmap.Dispose(); this.previousBitmap = image; this.thisBitmap = image2; this.nowPositionF = this.nowPositionF + (float)height - (float)num2; } } return(bitmap); }
public override System.Drawing.Bitmap getNew() { LedElement ledElement = this.content.Elements[0]; System.Drawing.Size size = this.content.GetSize(); if (this.nowDisplay == null) { this.newBitmap = LedGraphics.GetBmpFromFile(size, this.nowIndex, this.content.GetFileFullPath()); this.nowDisplay = base.GetMarqueeDisplayPageInstance(this.content.EffectsSetting, null, this.newBitmap); this.nowIndex++; } System.Drawing.Bitmap next = this.nowDisplay.GetNext(); if (next != null) { return(next); } if (this.nowIndex >= ledElement.PageCount) { this.nowIndex = 0; try { this.newBitmap.Dispose(); this.oldBitmap.Dispose(); } catch { } return(null); } if (this.content.EffectsSetting.ExitMode == 0) { if (this.oldBitmap != null) { this.oldBitmap.Dispose(); } this.oldBitmap = (System.Drawing.Bitmap) this.newBitmap.Clone(); this.newBitmap = LedGraphics.GetBmpFromFile(size, this.nowIndex, this.content.GetFileFullPath()); this.nowDisplay = base.GetMarqueeDisplayPageInstance(this.content.EffectsSetting, this.oldBitmap, this.newBitmap); } else { this.newBitmap = LedGraphics.GetBmpFromFile(size, this.nowIndex, this.content.GetFileFullPath()); this.nowDisplay = base.GetMarqueeDisplayPageInstance(this.content.EffectsSetting, null, this.newBitmap); } this.nowIndex++; return(this.nowDisplay.GetNext()); }
public void PreviewDraw() { if (this.stringLibrary == null) { return; } this.stringLibrary.PreviewDraw(); if (this.stringLibrary.LastDrawn == null) { return; } System.Drawing.Bitmap bitmap = LedGraphics.ScaleAndGrid(this.stringLibrary.LastDrawn, this.stringLibrary.Zoom); if (bitmap != null) { this.picPreview.Width = bitmap.Width; this.picPreview.Height = bitmap.Height; this.pnlPreview.AutoScroll = true; int x; if (this.pnlPreview.Width < bitmap.Width) { x = 0; } else { this.pnlPreview.HorizontalScroll.Value = this.pnlPreview.HorizontalScroll.Minimum; this.pnlPreview.HorizontalScroll.Visible = false; x = 5; } int y; if (this.pnlPreview.Height < bitmap.Height) { y = 0; } else { this.pnlPreview.VerticalScroll.Value = this.pnlPreview.VerticalScroll.Minimum; this.pnlPreview.VerticalScroll.Visible = false; y = (this.pnlPreview.Height - bitmap.Height) / 2; } this.picPreview.Location = new System.Drawing.Point(x, y); formMain.ReleasePicture(this.picPreview, bitmap); } }
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; }
public override System.Drawing.Bitmap getNew() { System.Drawing.Bitmap result; lock (this.AllBit) { LedElement ledElement = this.content.Elements[0]; System.Drawing.Size size = this.content.GetSize(); int width = size.Width; int height = size.Height; System.Drawing.Bitmap bitmap = new System.Drawing.Bitmap(width, height); System.Drawing.Graphics graphics = System.Drawing.Graphics.FromImage(bitmap); this.nowPosition = (int)this.nowPositionF; if (this.nowPositionF < (float)(-(float)size.Height)) { this.nowPositionF = (float)this.AllBit.Height; } if (this.nowPosition <= 0) { this.nowPosition = 0; this.nowPositionF = 0f; this.nowLoopNum++; if (this.nowLoopNum > this.content.EffectsSetting.LoopCount) { result = null; return(result); } } if (this.AllBit.Height - this.nowPosition < height) { graphics.DrawImage(this.AllBit, new System.Drawing.Rectangle(0, 0, width, height), new System.Drawing.Rectangle(0, this.nowPosition, width, height), System.Drawing.GraphicsUnit.Pixel); if (this.nowLoopNum < this.content.EffectsSetting.LoopCount) { graphics.DrawImage(this.AllBit, new System.Drawing.Point(0, this.AllBit.Height - this.nowPosition)); } } else { graphics.DrawImage(this.AllBit, new System.Drawing.Rectangle(0, 0, bitmap.Width, bitmap.Height), new System.Drawing.Rectangle(0, this.nowPosition, width, height), System.Drawing.GraphicsUnit.Pixel); } if (this.positionMark >= (float)(size.Height * 2) && ledElement.PageNumber < ledElement.PageCount) { this.nowPositionF += (float)size.Height; this.positionMark -= (float)size.Height; System.Drawing.Graphics graphics2 = System.Drawing.Graphics.FromImage(this.AllBit); System.Drawing.Bitmap bitmap2 = new System.Drawing.Bitmap(size.Width, size.Height * 2); System.Drawing.Graphics graphics3 = System.Drawing.Graphics.FromImage(bitmap2); graphics3.DrawImage(this.AllBit, new System.Drawing.Rectangle(0, 0, bitmap2.Width, bitmap2.Height), new System.Drawing.Rectangle(0, 0, bitmap2.Width, bitmap2.Height), System.Drawing.GraphicsUnit.Pixel); graphics3.Dispose(); System.Drawing.Bitmap bmpFromFile = LedGraphics.GetBmpFromFile(size, ledElement.PageCount - ledElement.PageNumber - 1, this.content.GetFileFullPath()); graphics2.DrawImage(bitmap2, new System.Drawing.Point(0, size.Height)); graphics2.DrawImage(bmpFromFile, new System.Drawing.Point(0, 0)); bitmap2.Dispose(); bmpFromFile.Dispose(); ledElement.PageNumber++; } this.nowPositionF -= MarqueeDisplay.speedEntryBase / (float)this.content.EffectsSetting.EntrySpeed; this.positionMark += MarqueeDisplay.speedEntryBase / (float)this.content.EffectsSetting.EntrySpeed; result = (System.Drawing.Bitmap)bitmap.Clone(); } return(result); }
public override System.Drawing.Bitmap getNew() { System.Drawing.Size size = this.content.GetSize(); LedElement ledElement = this.content.Elements[0]; System.Drawing.Bitmap result; lock (this.AllBit) { if (this.nowPosition >= this.AllBit.Width) { this.nowPositionF = (float)(-(float)size.Width); } int width = size.Width; int height = size.Height; System.Drawing.Bitmap bitmap = new System.Drawing.Bitmap(width, height); System.Drawing.Graphics graphics = System.Drawing.Graphics.FromImage(bitmap); this.nowPosition = (int)this.nowPositionF; if (this.nowPosition >= this.AllBit.Width) { this.nowPosition = 0; this.nowPositionF = 0f; this.nowLoopNum++; if (this.NeedChangeContent) { result = null; return(result); } } if (this.AllBit.Width - this.nowPosition < width) { graphics.DrawImage(this.AllBit, new System.Drawing.Rectangle(0, 0, width, height), new System.Drawing.Rectangle(this.nowPosition, 0, width, height), System.Drawing.GraphicsUnit.Pixel); graphics.DrawImage(this.AllBit, new System.Drawing.Rectangle(width - (width - (this.AllBit.Width - this.nowPosition)), 0, width, height), new System.Drawing.Rectangle(0, 0, width, height), System.Drawing.GraphicsUnit.Pixel); if (this.nowLoopNum < this.content.EffectsSetting.LoopCount) { graphics.DrawImage(this.AllBit, new System.Drawing.Point(this.AllBit.Width - this.nowPosition, 0)); } } else { graphics.DrawImage(this.AllBit, new System.Drawing.Rectangle(0, 0, bitmap.Width, bitmap.Height), new System.Drawing.Rectangle(this.nowPosition, 0, width, height), System.Drawing.GraphicsUnit.Pixel); } this.nowPositionF += MarqueeDisplay.speedEntryBase / (float)this.content.EffectsSetting.EntrySpeed; if (this.nowPosition >= size.Width && ledElement.PageNumber < ledElement.PageCount) { this.nowPositionF -= (float)size.Width; System.Drawing.Graphics graphics2 = System.Drawing.Graphics.FromImage(this.AllBit); System.Drawing.Bitmap bitmap2 = new System.Drawing.Bitmap(size.Width * 2, size.Height); System.Drawing.Graphics graphics3 = System.Drawing.Graphics.FromImage(bitmap2); graphics3.DrawImage(this.AllBit, new System.Drawing.Rectangle(0, 0, bitmap2.Width, bitmap2.Height), new System.Drawing.Rectangle(size.Width, 0, size.Width * 2, size.Height), System.Drawing.GraphicsUnit.Pixel); graphics3.Dispose(); System.Drawing.Bitmap bmpFromFile = LedGraphics.GetBmpFromFile(size, ledElement.PageNumber, this.content.GetFileFullPath()); graphics2.DrawImage(bitmap2, new System.Drawing.Point(0, 0)); graphics2.FillRectangle(new System.Drawing.SolidBrush(System.Drawing.Color.Black), new System.Drawing.Rectangle(bitmap2.Width, 0, bmpFromFile.Width, bmpFromFile.Height)); graphics2.DrawImage(bmpFromFile, new System.Drawing.Point(bitmap2.Width, 0)); bitmap2.Dispose(); bmpFromFile.Dispose(); ledElement.PageNumber++; } result = (System.Drawing.Bitmap)bitmap.Clone(); } return(result); }
public void RefrshAnimation(bool pGenerate) { this.isGenerate = pGenerate; if (this.isBackgroundModel) { return; } System.Drawing.Bitmap image = new System.Drawing.Bitmap(10, 10); System.Drawing.Graphics.FromImage(image); System.Drawing.Size stringToBitmapSize = LedGraphics.GetStringToBitmapSize("国", this.animation.EAnimation.Font.GetFont()); System.Drawing.Size stringToBitmapSize2 = LedGraphics.GetStringToBitmapSize("w", this.animation.EAnimation.Font.GetFont()); int num = stringToBitmapSize.Width * 100; int num2 = stringToBitmapSize2.Width * 110; int num3 = (int)((float)(num / 100) * -0.06f); num3 += this.animation.AnimationEffectsSetting.Kerning; this.finalSpace = num3; if (this.isLoadingParam) { return; } System.Drawing.Size size = this.displaySize; string text = "<invoke name=\"addText\" returntype=\"xml\"><arguments><string>"; text = text + this.GetMovieString() + "`"; text = text + size.Width.ToString() + "`"; text = text + size.Height.ToString() + "`"; text = text + this.TransFont(this.animation.EAnimation.Font.FamilyName) + "`"; text = text + (int)((double)this.animation.EAnimation.Font.Size / 72.0 * 96.0) + "`"; text = text + (int)this.animation.EAnimation.Align + "`"; text = text + num3.ToString() + "`"; text = text + this.animation.EAnimation.VerticalOffset + "`"; text = text + this.animation.EAnimation.HorizontalOffset + "`"; text = text + AnimationMaker.GetColorRGB(this.animation.EAnimation.ForeColor) + "`"; text = text + AnimationMaker.GetColorRGB(this.animation.EAnimation.ForeColor) + "`"; text = text + AnimationMaker.GetColorRGB(this.animation.EAnimation.ForeColor) + "`"; text = text + this.GetboolStr(this.animation.EAnimation.ColorRandomized) + "`"; text = text + this.GetboolStr(this.animation.EAnimation.Font.Bold) + "`"; text = text + this.GetboolStr(this.animation.EAnimation.Font.Italic) + "`"; text = text + this.GetboolStr(this.animation.EAnimation.Font.Underline) + "`"; text = text + this.GetboolStr(pGenerate) + "`"; text = text + this.animation.EAnimation.Speed + "`"; text = text + this.GetAlphaString(this.animation.EAnimation.Alpha) + "`"; text = text + AnimationMaker.GetColorRGB(this.animation.EAnimation.BackColor) + "`"; text = text + this.animation.Background.EffectsValueName + ".swf`"; text = text + this.GetboolStr(this.animation.Background.Enabled) + "`"; if (AnimationMaker.IsEffectNoStay(this.animation.AnimationEffectsSetting.Name)) { text += "0`"; } else { text += "2000`"; } text = text + num.ToString() + "`"; text = text + num2.ToString() + "`"; text += "</string></arguments></invoke>"; try { this.player.CallFunction(text); } catch { } }
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; } } }
public override System.Drawing.Bitmap getNew() { System.Drawing.Size size = this.content.GetSize(); int width = size.Width; int height = size.Height; if (this.content.EffectiveLength <= width) { System.Drawing.Bitmap bmpFromFile = LedGraphics.GetBmpFromFile(size, 0, this.content.GetFileFullPath()); System.Drawing.Bitmap bitmap = new System.Drawing.Bitmap(this.content.EffectiveLength, height); System.Drawing.Graphics graphics = System.Drawing.Graphics.FromImage(bitmap); graphics.DrawImage(bmpFromFile, new System.Drawing.Point(0, 0)); int i; for (i = 0; i <= width; i += bitmap.Width) { } System.Drawing.Bitmap bitmap2 = new System.Drawing.Bitmap(i, height); System.Drawing.Graphics graphics2 = System.Drawing.Graphics.FromImage(bitmap2); for (int j = 0; j < i; j += bitmap.Width) { graphics2.DrawImage(bitmap, new System.Drawing.Point(j, 0)); } System.Drawing.Bitmap bitmap3 = new System.Drawing.Bitmap(width, height); System.Drawing.Graphics graphics3 = System.Drawing.Graphics.FromImage(bitmap3); int num = (int)this.nowPositionF; int x = 0; if (num > width) { x = num - width; num = width; } int x2 = width - num; graphics3.DrawImage(bitmap2, new System.Drawing.Rectangle(x2, 0, num, height), new System.Drawing.Rectangle(x, 0, num, height), System.Drawing.GraphicsUnit.Pixel); if (this.drawHead) { graphics3.DrawImage(bitmap2, new System.Drawing.Rectangle(0, 0, width - num, height), new System.Drawing.Rectangle(bitmap2.Width - (width - num), 0, width - num, height), System.Drawing.GraphicsUnit.Pixel); } if (this.nowPositionF > (float)bitmap2.Width) { this.nowPositionF -= (float)bitmap2.Width; this.drawHead = true; } this.nowPositionF += MarqueeDisplay.speedEntryBase / (float)this.content.EffectsSetting.EntrySpeed; bmpFromFile.Dispose(); bitmap.Dispose(); bitmap2.Dispose(); return(bitmap3); } int num2 = (int)this.nowPositionF; if (num2 == 0) { num2 = 1; } if (num2 > width) { num2 = width; } int num3 = (int)this.nowPositionF; if (num3 < width) { num3 = 0; } else { num3 -= width; } if (this.nowPositionF > (float)this.content.EffectiveLength) { this.nowPositionF -= (float)this.content.EffectiveLength; this.drawHead = true; } this.nowPositionF += MarqueeDisplay.speedEntryBase / (float)this.content.EffectsSetting.EntrySpeed; System.Drawing.Bitmap bmpFromFile2 = LedGraphics.GetBmpFromFile(num2, height, num3, this.content.GetFileFullPath()); if (num2 == width) { return(bmpFromFile2); } System.Drawing.Bitmap bitmap4 = new System.Drawing.Bitmap(width, height); System.Drawing.Graphics graphics4 = System.Drawing.Graphics.FromImage(bitmap4); graphics4.DrawImage(bmpFromFile2, new System.Drawing.Point(width - num2, 0)); bmpFromFile2.Dispose(); if (this.drawHead) { int num4 = width - num2; int offset = this.content.EffectiveLength - num4; System.Drawing.Bitmap bmpFromFile3 = LedGraphics.GetBmpFromFile(num4, height, offset, this.content.GetFileFullPath()); graphics4.DrawImage(bmpFromFile3, new System.Drawing.Point(0, 0)); bmpFromFile3.Dispose(); } return(bitmap4); }