Example #1
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;
        }
Example #2
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();
                }
            }
        }
Example #3
0
        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);
        }
Example #4
0
        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);
        }
Example #5
0
        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());
        }
Example #6
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;
        }
Example #7
0
 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);
 }
Example #8
0
        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);
        }