Esempio n. 1
0
        public frmSpriteView(string fileName, bool isNew)
        {
            InitializeComponent();

            _fileName = fileName;

            if (!isNew)
            {
                Sprite sprite = new Sprite();
                sprite.Load(fileName);

                if (sprite.SpriteBitmap != null)
                {
                    txtFrameWidth.Text = sprite.Header.FrameWidth.ToString();
                    txtFrameHeight.Text = sprite.Header.FrameHeight.ToString();
                    txtFramesCount.Text = sprite.Header.FramesCount.ToString();
                    txtLines.Text = sprite.Header.Lines.ToString();
                    txtColor.BackColor = Color.FromArgb(sprite.Header.TransparentColorR, sprite.Header.TransparentColorG, sprite.Header.TransparentColorB);
                    pictureBox.Image = sprite.SpriteBitmap;

                }
            }
            else
            {
                pictureBox.ImageLocation = fileName;
            }
        }
Esempio n. 2
0
 public MainForm()
 {
     InitializeComponent();
     gr = this.panel1.CreateGraphics();
     Sprite s = new Sprite();
     s.SpriteBitmap = sprite;
     s.Load("e:\\3.spr");
     s.ApplyTransparentColor();
     sprite = s.SpriteBitmap;
     frameCount = 0;
     timer1.Start();
     timer2.Start();
     _x = panel1.Location.X;
     _y = panel1.Location.Y;
 }