public void onResizeEndTest() { BMPLogic logic = new BMPLogic(300, 300); Bitmap bmp = logic.onResizeEnd(new MouseEventArgs(MouseButtons.Left, 0, 250, 250, -1), new Size(400, 400)); Assert.Equal(bmp.Width, 400); Assert.Equal(bmp.Height, 400); }
/// <summary> /// Обарботка изменения размера /// </summary> /// <param name="sender">Отправитель</param> /// <param name="e">Параметры</param> private void Form1_ResizeEnd(object sender, System.EventArgs e) { picture.Size = new Size(Size.Width - 90, Size.Height - 137); picture.Image = logic.onResizeEnd(e, picture.Size); }