zoukankan      html  css  js  c++  java
  • 【OPPO主题制作系列

    参考OPPO主题设计师站:

    http://dev.theme.oppomobile.com/user/user_start

    想要打包成Theme文件,必须把需要打包的文件夹拖到oppo-themepack.exe这个应用程序上执行:

    每次拖来拖去都很麻烦,然后就写个程序一键执行:

     主要代码:

    /// <summary>
            /// 生成Theme文件
            /// </summary>
            /// <param name="sender"></param>
            /// <param name="e"></param>
            private void btnGenerate_Click(object sender, EventArgs e)
            {
                if (string.IsNullOrWhiteSpace(this.txtPathFolder.Text))
                {
                    return;
                }
    
                var packToolPath = @"....PackToolsoppo-themepack.exe"; // 打包的exe程序绝对路径
                var themeFolderPath = this.txtPathFolder.Text.Trim();   // 需要打包的文件夹目录
                var myProcess = new Process();
                var myStartInfo = new ProcessStartInfo(packToolPath, themeFolderPath);
                myProcess.StartInfo = myStartInfo;
                myProcess.Start();
                myProcess.WaitForExit(); //等待程序退出
    
                var generateThemeFolder = Directory.GetParent(themeFolderPath).ToString();
                DialogResult dr = MessageBox.Show($"打包完成,文件存放路径:{generateThemeFolder},是否打开Theme文件所在文件夹?", "提示", MessageBoxButtons.OKCancel);
                if (dr == DialogResult.OK)
                {
                    Process.Start("Explorer.exe", generateThemeFolder);
                }
                this.txtPathFolder.Text = string.Empty;
            }
    
            /// <summary>
            /// 选择需要打包的Theme文件目录
            /// </summary>
            /// <param name="sender"></param>
            /// <param name="e"></param>
            private void btnPathFolder_Click(object sender, EventArgs e)
            {
                FolderBrowserDialog dialog = new FolderBrowserDialog();
                dialog.Description = "请选择文件路径";
                if (dialog.ShowDialog() == DialogResult.OK)
                {
                    this.txtPathFolder.Text = dialog.SelectedPath;
                }
            }

    源码:ThemeGenerateTool.rar

  • 相关阅读:
    When to Partition a Table and an Index
    Hello, world
    提交
    SubmitOncePage:解决刷新页面造成的数据重复提交问题
    压缩ASP.NET中的ViewState
    asp.net千奇百怪的日历
    ICallbackEventHandler实现
    xml數據
    CrystalReports
    [转]Microsoft Visual Studio 2005中使用水晶报表
  • 原文地址:https://www.cnblogs.com/elliot-lei/p/7346731.html
Copyright © 2011-2022 走看看