예제 #1
0
        public CustomColor(string ColorFile)
        {
            file = ColorFile;

            string content = FileFolderHelper.FileToString(file);

            ColorTable            = Helper.CreateDataTable(content);
            ColorTable.PrimaryKey = new DataColumn[] { ColorTable.Columns[0] };
        }
예제 #2
0
        public ImageDialog(string filename)
        {
            InitializeComponent();
            m_strFileName = filename;

            int    nPos          = m_strFileName.LastIndexOf('.');
            string strExpandName = m_strFileName.Substring(nPos, m_strFileName.Length - nPos).ToLower();

            listBox1.Items.Clear();
            if (strExpandName == ".tga")
            {
                string itemText = "0 0 0 " + m_strFileName;
                listBox1.Items.Add(itemText);
            }
            else if (strExpandName == ".uitex")
            {
                string    strfile = FileFolderHelper.FileToString(m_strFileName.Substring(0, nPos) + ".txt");
                DataTable dt      = Helper.CreateDataTable(strfile);

                foreach (DataRow row in dt.Rows)
                {
                    string strFrame  = row["Farme"].ToString();
                    string strWidth  = row["Width"].ToString();
                    string strHeight = row["High"].ToString();

                    if (Int32.Parse(strWidth) != 0)
                    {
                        string itemText = strFrame + " " + strWidth + " " + strHeight + " " + row["File"].ToString();
                        listBox1.Items.Add(itemText);
                    }
                }
            }
            else
            {
                MessageBox.Show("不支持的文件格式");
            }
        }