コード例 #1
0
ファイル: AnimationMaker.cs プロジェクト: a532367171/LEDV6
        public void changeMaterial()
        {
            if (this.isBackgroundModel)
            {
                try
                {
                    this.player.Location = new System.Drawing.Point(0, 0);
                    this.player.Size     = new System.Drawing.Size(this.displaySize.Width + 10, this.displaySize.Height + 10);
                    this.player.Movie    = LedCommonConst.MaterialSwfPath + this.background.MaterialName;
                    this.player.Scale(new System.Drawing.SizeF((float)(this.displaySize.Width + 10), (float)(this.displaySize.Height + 10)));
                    this.player.ScaleMode = 2;
                    this.player.Play();
                    return;
                }
                catch
                {
                    return;
                }
            }
            LedEffects dataByName  = AnimationMaker.GetDataByName(this.animation.AnimationEffectsSetting.Name);
            FileStream fileStream  = new FileStream(AnimationMaker.tempDir + "\\efl.zhs", FileMode.Create);
            FileStream fileStream2 = new FileStream(AnimationMaker.tempDir + "\\efl1.zhs", FileMode.Create);

            fileStream.Write(dataByName.OriginalData, 0, dataByName.OriginalData.Length);
            fileStream2.Write(dataByName.OriginalData, 0, dataByName.OriginalData.Length);
            fileStream.Close();
            fileStream2.Close();
            File.Delete(AnimationMaker.tempDir + "\\back.xml");
            try
            {
                this.player.Movie = AnimationMaker.tempDir + "\\efl1.zhs";
            }
            catch
            {
                this.player.Movie = AnimationMaker.tempDir + "\\efl.zhs";
            }
            this.RefrshAnimation(false);
        }
コード例 #2
0
ファイル: AnimationMaker.cs プロジェクト: a532367171/LEDV6
        public void ChangeEffect()
        {
            if (this.isBackgroundModel)
            {
                try
                {
                    LedEffects   dataByName   = AnimationMaker.GetDataByName(this.background.EffectsValueName);
                    FileStream   fileStream   = new FileStream(AnimationMaker.tempDir + "\\efl.zhs", FileMode.Create);
                    FileStream   fileStream2  = new FileStream(AnimationMaker.tempDir + "\\efl1.zhs", FileMode.Create);
                    StreamWriter streamWriter = new StreamWriter(AnimationMaker.tempDir + "\\back.xml", false);
                    fileStream.Write(dataByName.OriginalData, 0, dataByName.OriginalData.Length);
                    fileStream2.Write(dataByName.OriginalData, 0, dataByName.OriginalData.Length);
                    string text = dataByName.PropertyXml.Replace("Movie.Back.Width", (this.displaySize.Width + 20).ToString());
                    text = text.Replace("Movie.Back.Height", (this.displaySize.Height + 10).ToString());
                    int num = text.IndexOf("Param.Back.Number");
                    if (num > 0)
                    {
                        string text2            = text.Substring(num, 20);
                        string backgroundNumber = AnimationMaker.GetBackgroundNumber(this.background.EffectsValueName, text2, this.displaySize);
                        text = text.Replace(text2, backgroundNumber);
                        streamWriter.Write(text);
                    }
                    else
                    {
                        streamWriter.Write(text);
                    }
                    streamWriter.Close();
                    fileStream.Close();
                    fileStream2.Close();
                    this.player.Size = new System.Drawing.Size(this.player.Width + 3, this.player.Height);
                    try
                    {
                        this.player.Movie = AnimationMaker.tempDir + "\\efl.zhs";
                    }
                    catch
                    {
                        this.player.Movie = AnimationMaker.tempDir + "\\efl1.zhs";
                    }
                    return;
                }
                catch
                {
                    return;
                }
            }
            LedEffects dataByName2 = AnimationMaker.GetDataByName(this.animation.AnimationEffectsSetting.Name);
            FileStream fileStream3 = new FileStream(AnimationMaker.tempDir + "\\efl.zhs", FileMode.Create);
            FileStream fileStream4 = new FileStream(AnimationMaker.tempDir + "\\efl1.zhs", FileMode.Create);

            fileStream3.Write(dataByName2.OriginalData, 0, dataByName2.OriginalData.Length);
            fileStream4.Write(dataByName2.OriginalData, 0, dataByName2.OriginalData.Length);
            fileStream3.Close();
            fileStream4.Close();
            File.Delete(AnimationMaker.tempDir + "\\back.xml");
            try
            {
                this.player.Movie = AnimationMaker.tempDir + "\\efl1.zhs";
            }
            catch
            {
                this.player.Movie = AnimationMaker.tempDir + "\\efl.zhs";
            }
            this.RefrshAnimation(false);
        }