private static void Check_MetafileHeader_WmfPlaceable(MetafileHeader header) { Assert.Equal(MetafileType.WmfPlaceable, header.Type); Assert.Equal(0x300, header.Version); // filesize - 22, which happens to be the size (22) of a PLACEABLEMETAHEADER struct Assert.Equal(3474, header.MetafileSize); Assert.Equal(-30, header.Bounds.X); Assert.Equal(-40, header.Bounds.Y); Assert.Equal(3096, header.Bounds.Width); Assert.Equal(4127, header.Bounds.Height); Assert.Equal(606, header.DpiX); Assert.Equal(606, header.DpiY); Assert.Equal(0, header.EmfPlusHeaderSize); Assert.Equal(0, header.LogicalDpiX); Assert.Equal(0, header.LogicalDpiY); Assert.NotNull(header.WmfHeader); Check_MetaHeader_WmfPlaceable(header.WmfHeader); Assert.False(header.IsDisplay()); Assert.False(header.IsEmf()); Assert.False(header.IsEmfOrEmfPlus()); Assert.False(header.IsEmfPlus()); Assert.False(header.IsEmfPlusDual()); Assert.False(header.IsEmfPlusOnly()); Assert.True(header.IsWmf()); Assert.True(header.IsWmfPlaceable()); }
public static void Check_MetafileHeader_WmfPlaceable(MetafileHeader header) { Assert.AreEqual(MetafileType.WmfPlaceable, header.Type, "Type"); Assert.AreEqual(0x300, header.Version, "Version"); // filesize - 22, which happens to be the size (22) of a PLACEABLEMETAHEADER struct Assert.AreEqual(3474, header.MetafileSize, "MetafileSize"); Assert.AreEqual(-30, header.Bounds.X, "Bounds.X"); Assert.AreEqual(-40, header.Bounds.Y, "Bounds.Y"); Assert.AreEqual(3096, header.Bounds.Width, "Bounds.Width"); Assert.AreEqual(4127, header.Bounds.Height, "Bounds.Height"); Assert.AreEqual(606, header.DpiX, "DpiX"); Assert.AreEqual(606, header.DpiY, "DpiY"); Assert.AreEqual(0, header.EmfPlusHeaderSize, "EmfPlusHeaderSize"); Assert.AreEqual(0, header.LogicalDpiX, "LogicalDpiX"); Assert.AreEqual(0, header.LogicalDpiY, "LogicalDpiY"); Assert.IsNotNull(header.WmfHeader, "WmfHeader"); Check_MetaHeader_WmfPlaceable(header.WmfHeader); Assert.IsFalse(header.IsDisplay(), "IsDisplay"); Assert.IsFalse(header.IsEmf(), "IsEmf"); Assert.IsFalse(header.IsEmfOrEmfPlus(), "IsEmfOrEmfPlus"); Assert.IsFalse(header.IsEmfPlus(), "IsEmfPlus"); Assert.IsFalse(header.IsEmfPlusDual(), "IsEmfPlusDual"); Assert.IsFalse(header.IsEmfPlusOnly(), "IsEmfPlusOnly"); Assert.IsTrue(header.IsWmf(), "IsWmf"); Assert.IsTrue(header.IsWmfPlaceable(), "IsWmfPlaceable"); }
private static void Check_MetafileHeader_Emf(MetafileHeader header) { Assert.Equal(MetafileType.Emf, header.Type); Assert.Equal(65536, header.Version); // extactly the filesize Assert.Equal(20456, header.MetafileSize); Assert.Equal(0, header.Bounds.X); Assert.Equal(0, header.Bounds.Y); Assert.Throws <ArgumentException>(() => header.WmfHeader); Assert.False(header.IsDisplay()); Assert.True(header.IsEmf()); Assert.True(header.IsEmfOrEmfPlus()); Assert.False(header.IsEmfPlus()); Assert.False(header.IsEmfPlusDual()); Assert.False(header.IsEmfPlusOnly()); Assert.False(header.IsWmf()); Assert.False(header.IsWmfPlaceable()); }
public static void Check_MetafileHeader_Emf(MetafileHeader header) { Assert.AreEqual(MetafileType.Emf, header.Type, "Type"); Assert.AreEqual(65536, header.Version, "Version"); // extactly the filesize Assert.AreEqual(20456, header.MetafileSize, "MetafileSize"); Assert.AreEqual(0, header.Bounds.X, "Bounds.X"); Assert.AreEqual(0, header.Bounds.Y, "Bounds.Y"); #if false Assert.AreEqual(759, header.Bounds.Width, "Bounds.Width"); Assert.AreEqual(1073, header.Bounds.Height, "Bounds.Height"); Assert.AreEqual(96f, header.DpiX, 0.5f, "DpiX"); Assert.AreEqual(96f, header.DpiY, 0.5f, "DpiY"); Assert.AreEqual(6619188, header.EmfPlusHeaderSize, "EmfPlusHeaderSize"); Assert.AreEqual(3670064, header.LogicalDpiX, "LogicalDpiX"); Assert.AreEqual(3670064, header.LogicalDpiY, "LogicalDpiY"); #endif try { Assert.IsNotNull(header.WmfHeader, "WmfHeader"); Assert.Fail("WmfHeader didn't throw an ArgumentException"); } catch (ArgumentException) { } catch (Exception e) { Assert.Fail("WmfHeader didn't throw an ArgumentException but: {0}.", e.ToString()); } Assert.IsFalse(header.IsDisplay(), "IsDisplay"); Assert.IsTrue(header.IsEmf(), "IsEmf"); Assert.IsTrue(header.IsEmfOrEmfPlus(), "IsEmfOrEmfPlus"); Assert.IsFalse(header.IsEmfPlus(), "IsEmfPlus"); Assert.IsFalse(header.IsEmfPlusDual(), "IsEmfPlusDual"); Assert.IsFalse(header.IsEmfPlusOnly(), "IsEmfPlusOnly"); Assert.IsFalse(header.IsWmf(), "IsWmf"); Assert.IsFalse(header.IsWmfPlaceable(), "IsWmfPlaceable"); }