예제 #1
0
        public void TestImage()
        {
            var expected = new Bitmap(256, 256);

            _manipulator = new ImageManipulator(expected);

            Assert.AreEqual(expected, _manipulator.Image);
        }
예제 #2
0
        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);
        }
예제 #3
0
 public void SetUp()
 {
     _manipulator = new ImageManipulator(new Bitmap(1024, 768));
 }
예제 #4
0
 public void TearDown()
 {
     _manipulator = null;
 }
예제 #5
0
        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";
        }