コード例 #1
0
		public bool IsFitToInsert(SlideSettings currentSlideSettings)
		{
			var currentWidth = (Int32)Math.Round(currentSlideSettings.SizeWidth);
			var slideWidth = (Int32)Math.Round(_slideWidth);
			return slideWidth == 0 || currentWidth == slideWidth;
		}
コード例 #2
0
		public SlideSettings GetSlideSettings()
		{
			try
			{
				var settings = new SlideSettings();
				if (PowerPointObject?.ActivePresentation == null) return null;
				settings.SizeWidth = PowerPointObject.ActivePresentation.PageSetup.SlideWidth / 72;
				settings.SizeHeght = PowerPointObject.ActivePresentation.PageSetup.SlideHeight / 72;
				switch (PowerPointObject.ActivePresentation.PageSetup.SlideOrientation)
				{
					case MsoOrientation.msoOrientationHorizontal:
						settings.Orientation = SlideOrientationEnum.Landscape;
						break;
					case MsoOrientation.msoOrientationVertical:
						settings.Orientation = SlideOrientationEnum.Portrait;
						break;
				}
				if (settings.SizeWidth == 10 && settings.SizeHeght == 5.625)
				{
					settings.SizeWidth = 13;
					settings.SizeHeght = 7.32;
				}
				return settings;
			}
			catch
			{
				return null;
			}
			finally
			{
			}
		}