private void CallFormResize(bool rescale)
        {
            using (SizeForm frm = new SizeForm())
            {
                frm.WidthSize  = _sprite.SpriteWidth;
                frm.HeightSize = _sprite.SpriteHeight;
                frm.UseScale   = rescale;
                if (frm.ShowDialog() == DialogResult.OK)
                {
                    _tilesetCtrl.ResizeTileset((short)frm.WidthSize, (short)frm.HeightSize, rescale);
                    for (short i = 0; i < _sprite.Images.Count; ++i)
                    {
                        _sprite.Images[i].Dispose();
                        _sprite.Images[i] = _tilesetCtrl.Tileset.Tiles[i].Graphic;
                    }
                    _sprite.SpriteWidth  = (short)frm.WidthSize;
                    _sprite.SpriteHeight = (short)frm.HeightSize;
                }
                SpriteDrawer.Content = (Bitmap)_sprite.GetImage(_selectedFrame.Index);
                UpdateControls();
                IsDirty = true;
            }

            // these method were made public to resize the contained image:
            FrameBaseEditor.UpdateCenterFrame();
            DirectionAnim.UpdateAnimPanel();
        }
Example #2
0
 private static void menuRescale_Click(object sender, EventArgs e)
 {
     using (SizeForm form = new SizeForm())
     {
         ImageEditView editor = PluginManager.Core.ActiveDocument as ImageEditView;
         form.WidthSize  = editor.Content.Width;
         form.HeightSize = editor.Content.Height;
         if (form.ShowDialog() == DialogResult.OK)
         {
             editor.Rescale(form.WidthSize, form.HeightSize, form.Mode);
         }
     }
 }
Example #3
0
        /// <summary>
        /// 显示纸张大小
        /// </summary>
        /// <param name="from"></param>
        /// <returns></returns>
        public static string ShowPaperSize(this Form from, string paperSize)
        {
            var size        = string.Empty;
            var messageForm = new SizeForm()
            {
                Text         = "请输入纸张大小",
                FormType     = "PaperSize",
                DefaultValue = paperSize
            };
            var diaResult = messageForm.ShowDialog();

            if (diaResult == DialogResult.OK)
            {
                var width  = messageForm.textBox1.Text;
                var height = messageForm.textBox2.Text;
                size = width + "," + height;
                if (size == ",")
                {
                    size = "empty";
                }
            }
            return(size);
        }
Example #4
0
		[Test] // bug #80621, #81125
		public void DontCallSizeFromClientSize ()
		{
			SizeControl sc = new SizeControl ();
			
			Assert.AreEqual (0, sc.size_from_client_size_count, "A1");
			
			sc.ClientSize = new Size (300, 300);
			Assert.AreEqual (0, sc.size_from_client_size_count, "A2");
			
			SizeForm sf = new SizeForm ();
			sf.ShowInTaskbar = false;
			sf.Show ();
			
			Assert.AreEqual (0, sc.size_from_client_size_count, "A3");

			sc.ClientSize = new Size (300, 300);
			Assert.AreEqual (0, sc.size_from_client_size_count, "A4");	
			
			sf.Dispose ();	
		}