public void TestImage() { var expected = new Bitmap(256, 256); _manipulator = new ImageManipulator(expected); Assert.AreEqual(expected, _manipulator.Image); }
public void TestCropResize() { var expected = new Size(340, 300); _manipulator.ScaleImage(expected, true); Assert.AreEqual(expected, _manipulator.Image.Size); _manipulator = new ImageManipulator(new Bitmap(1024, 768)); _manipulator.ScaleImage(expected.Width, expected.Height, true); Assert.AreEqual(expected, _manipulator.Image.Size); }
public void SetUp() { _manipulator = new ImageManipulator(new Bitmap(1024, 768)); }
public void TearDown() { _manipulator = null; }
private void btnOK_Click(object sender, EventArgs e) { var f = new FileInfo(FileName); var i = new ImageManipulator(FileName); i.ScaleImage(270, 300, true); string fileName = f.Name.Replace(f.Extension, ""); i.SaveImage(Common.Resources.ContentDirectory, fileName, ImageType.Png); //i.SaveImage("C:/Users/" + Environment.UserName + "/test/", fileName, ImageType.Png); _model.ImageUrl = Common.Resources.ContentDirectory + fileName + ".png"; //_model.ImageUrl = "C:/Users/" + Environment.UserName + "/test/" + fileName + ".png"; }