コード例 #1
0
        public AddSpriteDialog(MainForm owner, string filename) : this(owner, File.ReadAllBytes(filename))
        {
            //this._spriteThresholdLabel.Text = (this._spriteThresholdTrackBar.Value / 100.0f).ToString("0.00") + "%";
            this.thresholdTextBox.Text = (this._spriteThresholdTrackBar.Value / 100.0f).ToString("0.00");

            this.Template = new Sprite.Template(this._spriteNameTextBox.Text, File.ReadAllBytes(filename), this._spriteThresholdTrackBar.Value / 10000.0f);
        }
コード例 #2
0
        public AddSpriteDialog(MainForm owner, Sprite.Template sprite) : this(owner, sprite.Bytes)
        {
            this._spriteNameTextBox.Text        = sprite.Name;
            this._spriteThresholdTrackBar.Value = (int)(sprite.Threshold * 10000);

            //this._spriteThresholdLabel.Text = (this._spriteThresholdTrackBar.Value / 100.0f).ToString("0.00") + "%";
            this.thresholdTextBox.Text = (this._spriteThresholdTrackBar.Value / 100.0f).ToString("0.00");
            this.Template = sprite;

            if (sprite.Color != null)
            {
                this.color.Text       = ColorTranslator.ToHtml(sprite.Color.Value);
                this.errorFactor.Text = sprite.ErrorFactor.ToString();
            }
        }