示例#1
0
		public void Standard_Format_Portrait_Test()
		{
			var filmBox = new PrintScu.FilmBox(300, 600)
				{
					FilmOrientation = FilmOrientation.Portrait,
					FilmSizeId = FilmSize.Dimension_8in_x_10in,
					ImageDisplayFormat = ImageDisplayFormat.Standard_2x4
				};

			var imageBox = new PrintScu.ImageBox(filmBox, null);
			var filmBoxSize = filmBox.SizeInPixels;

			// Layout is 2x4, meaning 2 columns, 4 rows.
			// ImageBoxes are ordered top->bottom, left->right
			imageBox.ImageBoxPosition = 1;
			var imageBoxSize = imageBox.SizeInPixels;
			Assert.AreEqual(imageBoxSize.Width, filmBoxSize.Width / 2);
			Assert.AreEqual(imageBoxSize.Height, filmBoxSize.Height / 4);
			Assert.AreEqual(Math.Round(imageBox.PhysicalWidth, _floatingPointDigits), Math.Round(8 * LengthInMillimeter.Inch / 2, _floatingPointDigits));

			imageBox.ImageBoxPosition = 8;
			imageBoxSize = imageBox.SizeInPixels;
			Assert.AreEqual(imageBoxSize.Width, filmBoxSize.Width / 2);
			Assert.AreEqual(imageBoxSize.Height, filmBoxSize.Height / 4);
			Assert.AreEqual(Math.Round(imageBox.PhysicalWidth, _floatingPointDigits), Math.Round(8 * LengthInMillimeter.Inch / 2, _floatingPointDigits));
		}
示例#2
0
		public void Column_Format_Landscape_Test()
		{
			var filmBox = new PrintScu.FilmBox(300, 600)
			{
				FilmOrientation = FilmOrientation.Landscape,
				FilmSizeId = FilmSize.Dimension_8in_x_10in,
				ImageDisplayFormat = ImageDisplayFormat.COL_1_2
			};

			var imageBox = new PrintScu.ImageBox(filmBox, null);
			var filmBoxSize = filmBox.SizeInPixels;

			// Layout is Column 1,2, meaning 1 row in the left column and 2 rows in the right column
			imageBox.ImageBoxPosition = 1;
			var imageBoxSize = imageBox.SizeInPixels;
			Assert.AreEqual(imageBoxSize.Width, filmBoxSize.Width / 2);
			Assert.AreEqual(imageBoxSize.Height, filmBoxSize.Height);
			Assert.AreEqual(Math.Round(imageBox.PhysicalWidth, _floatingPointDigits), Math.Round(10 * LengthInMillimeter.Inch / 2, _floatingPointDigits));

			imageBox.ImageBoxPosition = 2;
			imageBoxSize = imageBox.SizeInPixels;
			Assert.AreEqual(imageBoxSize.Width, filmBoxSize.Width / 2);
			Assert.AreEqual(imageBoxSize.Height, filmBoxSize.Height / 2);
			Assert.AreEqual(Math.Round(imageBox.PhysicalWidth, _floatingPointDigits), Math.Round(10 * LengthInMillimeter.Inch / 2, _floatingPointDigits));

			imageBox.ImageBoxPosition = 3;
			imageBoxSize = imageBox.SizeInPixels;
			Assert.AreEqual(imageBoxSize.Width, filmBoxSize.Width / 2);
			Assert.AreEqual(imageBoxSize.Height, filmBoxSize.Height / 2);
			Assert.AreEqual(Math.Round(imageBox.PhysicalWidth, _floatingPointDigits), Math.Round(10 * LengthInMillimeter.Inch / 2, _floatingPointDigits));
		}
示例#3
0
		public void Row_Format_Portrait_Test()
		{
			var filmBox = new PrintScu.FilmBox(300, 600)
				{
					FilmOrientation = FilmOrientation.Portrait,
					FilmSizeId = FilmSize.Dimension_8in_x_10in,
					ImageDisplayFormat = ImageDisplayFormat.Row_1_2
				};

			var imageBox = new PrintScu.ImageBox(filmBox, null);
			var filmBoxSize = filmBox.SizeInPixels;

			// Layout is Row 1,2, meaning 1 column in top row and 2 columns in bottom row
			imageBox.ImageBoxPosition = 1;
			var imageBoxSize = imageBox.SizeInPixels;
			Assert.AreEqual(imageBoxSize.Width, filmBoxSize.Width);
			Assert.AreEqual(imageBoxSize.Height, filmBoxSize.Height / 2);
			Assert.AreEqual(Math.Round(imageBox.PhysicalWidth, _floatingPointDigits), Math.Round(8 * LengthInMillimeter.Inch, _floatingPointDigits));

			imageBox.ImageBoxPosition = 2;
			imageBoxSize = imageBox.SizeInPixels;
			Assert.AreEqual(imageBoxSize.Width, filmBoxSize.Width / 2);
			Assert.AreEqual(imageBoxSize.Height, filmBoxSize.Height / 2);
			Assert.AreEqual(Math.Round(imageBox.PhysicalWidth, _floatingPointDigits), Math.Round(8 * LengthInMillimeter.Inch / 2, _floatingPointDigits));

			imageBox.ImageBoxPosition = 3;
			imageBoxSize = imageBox.SizeInPixels;
			Assert.AreEqual(imageBoxSize.Width, filmBoxSize.Width / 2);
			Assert.AreEqual(imageBoxSize.Height, filmBoxSize.Height / 2);
			Assert.AreEqual(Math.Round(imageBox.PhysicalWidth, _floatingPointDigits), Math.Round(8 * LengthInMillimeter.Inch / 2, _floatingPointDigits));
		}