Exemplo n.º 1
0
        public static string EditMaterial(LedMaterialType ftype)
        {
            OpenFileDialog openFileDialog = new OpenFileDialog();

            openFileDialog.Filter = "(*.jpg;*.bmp;*.png;*.gif;*.swf;)|*.jpg;*.bmp;*.png;*.gif;*.swf";
            if (openFileDialog.ShowDialog() == DialogResult.OK)
            {
                if (string.Equals(Path.GetExtension(openFileDialog.FileName), ".swf", StringComparison.CurrentCultureIgnoreCase))
                {
                    ftype = LedMaterialType.Flash;
                }
                else if (string.Equals(Path.GetExtension(openFileDialog.FileName), ".gif", StringComparison.CurrentCultureIgnoreCase))
                {
                    ftype = LedMaterialType.Gif;
                }
                else if (string.Equals(Path.GetExtension(openFileDialog.FileName), ".png", StringComparison.CurrentCultureIgnoreCase) || string.Equals(Path.GetExtension(openFileDialog.FileName), ".jpg", StringComparison.CurrentCultureIgnoreCase) || string.Equals(Path.GetExtension(openFileDialog.FileName), ".bmp", StringComparison.CurrentCultureIgnoreCase))
                {
                    ftype = LedMaterialType.image;
                }
                formMaterialEdit formMaterialEdit = new formMaterialEdit(openFileDialog.FileName, ftype);
                DialogResult     dialogResult     = formMaterialEdit.ShowDialog();
                if (dialogResult == DialogResult.OK)
                {
                    return(formMaterialEdit.destPath);
                }
            }
            return("");
        }
Exemplo n.º 2
0
        public formMaterialEdit(string path, LedMaterialType ftype)
        {
            this.InitializeComponent();
            this.Suffix = Path.GetExtension(path);
            foreach (LedMaterial current in LedGlobal.LedMaterialList)
            {
                this.materialNameNum.Add(Path.GetFileNameWithoutExtension(current.Name));
            }
            this.previewPath        = LedCommonConst.MaterialPreviewPath;
            this.basisPath          = LedCommonConst.MaterialPath;
            this.MaterialParam.Type = ftype;
            string extension = Path.GetExtension(path);

            this.SetMaterialDestFileName(extension);
            this.sourPath = path;
            if (this.MaterialParam.Type == LedMaterialType.Gif)
            {
                this.pictureBoxMaterial.ImageLocation = path;
                return;
            }
            if (this.MaterialParam.Type == LedMaterialType.image)
            {
                this.pictureBoxMaterial.ImageLocation = path;
                return;
            }
            if (this.MaterialParam.Type == LedMaterialType.Flash)
            {
                this.pictureBoxMaterial.Hide();
                this.axShockwaveFlashMaterial.Show();
                this.axShockwaveFlashMaterial.Visible = true;
                this.axShockwaveFlashMaterial.BringToFront();
                this.axShockwaveFlashMaterial.Movie = this.sourPath;
                this.axShockwaveFlashMaterial.Play();
            }
        }
 private void LoadMaterial(LedMaterialType type)
 {
     if (type != LedMaterialType.Text)
     {
         this.LoadBackgroundMaterial_Pic();
     }
 }
 public void SelectEffect(LedBackground pBackground)
 {
     this.background         = pBackground;
     this.backOriginalName   = pBackground.MaterialName;
     this.backOriginalType   = pBackground.MaterialType;
     this.backOriginalLayout = pBackground.MaterialLayout;
     base.Size = new System.Drawing.Size(648, 349);
     this.Load_formEffectSelecter();
     base.ShowDialog();
 }