private void InitSprite(int width, int height)
{
string sheetpath = null;
if (Sprite != null && Sprite.SheetPath != null) sheetpath = Sprite.SheetPath.Absolute;
Sprite = new Sprite(width, height);
spriteWidth = width;
spriteHeight = height;
if (sheetpath != null) Sprite.SheetPath = FilePath.FromAbsolute(sheetpath, project.BaseDir);
frameTotalLabel.Text = "of " + Sprite.Count.ToString();
currentFrame.Minimum = 1;
currentFrame.Maximum = Sprite.Count;
duration.Value = 0;
textWidth.Text = Sprite.Width.ToString();
textHeight.Text = Sprite.Height.ToString();
InitPreview();
Sprite.Play();
if (SpriteChange != null) SpriteChange();
}