Example #1
0
            public ImageStretchFillViewbox()
            {
                global::System.Windows.Controls.Image image = new global::System.Windows.Controls.Image();
                image.Source = new BitmapImage(new Uri("Test.png", UriKind.Relative));
                Stretch      = Stretch.Fill;
                Child        = image;
                MaxWidth     = 100;
                MaxHeight    = 200;
                Window w = new Window();

                w.Content = this;
                w.Show();
                Assert.AreEqual(arrange_parameter, new Size(100, 200), "1");
                Assert.AreEqual(arrange_result, new Size(100, 200), "2");
                Assert.AreEqual(measure_parameter, new Size(100, 200), "3");
                Assert.AreEqual(measure_result, new Size(100, 200), "4");
            }
Example #2
0
            public ImageStretchDirectionDownOnlyViewbox()
            {
                StretchDirection = StretchDirection.DownOnly;
                global::System.Windows.Controls.Image image = new global::System.Windows.Controls.Image();
                image.Source = new BitmapImage(new Uri("Test.png", UriKind.Relative));
                Child        = image;
                MaxWidth     = 100;
                MaxHeight    = 200;
                Window w = new Window();

                w.Content = this;
                w.Show();
                Assert.AreEqual(arrange_parameter, new Size(100, 200), "1");
                Assert.AreEqual(arrange_result.Width, 34, "2");
                Assert.AreEqual(arrange_result.Height, 21, "2 1");
                Assert.AreEqual(measure_parameter, new Size(100, 200), "3");
                Assert.AreEqual(measure_result, new Size(34, 21), "4");
            }
Example #3
0
            public ImageStretchUniformToFillStretchDirectionUpOnlyViewbox()
            {
                StretchDirection = StretchDirection.UpOnly;
                global::System.Windows.Controls.Image image = new global::System.Windows.Controls.Image();
                image.Source = new BitmapImage(new Uri("Test.png", UriKind.Relative));
                Stretch      = Stretch.UniformToFill;
                Child        = image;
                MaxWidth     = 100;
                MaxHeight    = 200;
                Window w = new Window();

                w.Content = this;
                w.Show();
                Assert.AreEqual(arrange_parameter.Width, 323.8095238095238, "1");
                Assert.AreEqual(arrange_parameter.Height, 200, "1 1");
                Assert.AreEqual(arrange_result, new Size(323.8095238095238, 200), "2");
                Assert.AreEqual(measure_parameter, new Size(100, 200), "3");
                Assert.AreEqual(measure_result, new Size(323.8095238095238, 200), "4");
            }
Example #4
0
			public ImageStretchFillStretchDirectionDownOnlyViewbox ()
			{
				StretchDirection = StretchDirection.DownOnly;
				global::System.Windows.Controls.Image image = new global::System.Windows.Controls.Image ();
				image.Source = new BitmapImage (new Uri ("Test.png", UriKind.Relative));
				Stretch = Stretch.Fill;
				Child = image;
				MaxWidth = 100;
				MaxHeight = 200;
				Window w = new Window ();
				w.Content = this;
				w.Show ();
				Assert.AreEqual (arrange_parameter, new Size (100, 200), "1");
				Assert.AreEqual (arrange_result, new Size (34, 21), "2");
				Assert.AreEqual (measure_parameter, new Size (100, 200), "3");
				Assert.AreEqual (measure_result, new Size (34, 21), "4");
			}
Example #5
0
			public ImageStretchDirectionUpOnlyViewbox ()
			{
				StretchDirection = StretchDirection.UpOnly;
				global::System.Windows.Controls.Image image = new global::System.Windows.Controls.Image ();
				image.Source = new BitmapImage (new Uri ("Test.png", UriKind.Relative));
				Child = image;
				MaxWidth = 100;
				MaxHeight = 200;
				Window w = new Window ();
				w.Content = this;
				w.Show ();
				Assert.AreEqual (arrange_parameter, new Size (100, 200), "1");
				Assert.AreEqual (arrange_result.Width, 100, "2");
				Assert.AreEqual (arrange_result.Height, 61.764705882352942, "2 1");
				Assert.AreEqual (measure_parameter, new Size (100, 200), "3");
				Assert.AreEqual (measure_result, new Size (100, 61.764705882352942), "4");
			}
Example #6
0
			public ImageStretchUniformToFillViewbox ()
			{
				global::System.Windows.Controls.Image image = new global::System.Windows.Controls.Image ();
				image.Source = new BitmapImage (new Uri ("Test.png", UriKind.Relative));
				Stretch = Stretch.UniformToFill;
				Child = image;
				MaxWidth = 100;
				MaxHeight = 200;
				Window w = new Window ();
				w.Content = this;
				w.Show ();
				Assert.AreEqual (arrange_parameter.Width, 323.8095238095238, "1");
				Assert.AreEqual (arrange_parameter.Height, 200, "1 1");
				Assert.AreEqual (arrange_result, new Size (323.8095238095238, 200), "2");
				Assert.AreEqual (measure_parameter, new Size (100, 200), "3");
				Assert.AreEqual (measure_result, new Size (323.8095238095238, 200), "4");
			}