Esempio n. 1
0
        public Form1()
        {
            InitializeComponent();
            face = new Face();
            pictureBox1.Image = new Bitmap(552, 589);

            heads = new List<Image>();
            hair = new List<Image>();
            eyesL = new List<Image>();
            eyesR = new List<Image>();
            noses = new List<Image>();
            mouths = new List<Image>();

            heads.Add(Image.FromFile("shapes/face1.png"));
            heads.Add(Image.FromFile("shapes/face2.png"));
            heads.Add(Image.FromFile("shapes/face3.png"));
            hair.Add(Image.FromFile("shapes/hair1.png"));
            hair.Add(Image.FromFile("shapes/hair2.png"));
            hair.Add(Image.FromFile("shapes/hair3.png"));
            eyesL.Add(Image.FromFile("shapes/eye1.png"));
            eyesL.Add(Image.FromFile("shapes/eye2.png"));
            eyesL.Add(Image.FromFile("shapes/eye3.png"));
            eyesR.Add(Image.FromFile("shapes/eye1r.png"));
            eyesR.Add(Image.FromFile("shapes/eye2r.png"));
            eyesR.Add(Image.FromFile("shapes/eye3r.png"));
            noses.Add(Image.FromFile("shapes/nose1.png"));
            noses.Add(Image.FromFile("shapes/nose2.png"));
            noses.Add(Image.FromFile("shapes/nose3.png"));
            mouths.Add(Image.FromFile("shapes/mouth1.png"));
            mouths.Add(Image.FromFile("shapes/mouth2.png"));
            mouths.Add(Image.FromFile("shapes/mouth3.png"));
        }
Esempio n. 2
0
        //import
        private void toolStripButton3_Click(object sender, EventArgs e)
        {
            OpenFileDialog ofd = new OpenFileDialog();
            ofd.Filter = "Asset file|*.face;*.geom";
            ofd.Title = "Import asset";
            ofd.ShowDialog();

            if (ofd.FileName != "")
            {
                try
                {
                    System.IO.FileStream fs =
                       (System.IO.FileStream)ofd.OpenFile();

                    switch (Path.GetExtension(ofd.FileName))
                    {
                        case ".face":
                            BinaryFormatter bf = new BinaryFormatter();
                            Face f = (Face)bf.Deserialize(fs);
                            fs.Close();

                            face = f;
                            switchWorkMode(1);
                            break;

                        case ".geom":
                            pictureBox17.Visible = true;
                            pictureBox19.Visible = true;
                            pictureBox20.Visible = true;
                            pictureBox21.Visible = true;
                            pictureBox22.Visible = true;
                            pictureBox24.Visible = true;
                            pictureBox28.Visible = true;
                            pictureBox29.Visible = true;
                            pictureBox30.Visible = true;
                            pictureBox31.Visible = true;
                            pictureBox32.Visible = true;
                            pictureBox33.Visible = true;
                            switchWorkMode(2);
                            break;
                    }

                    fs.Close();
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
        }