本文整理汇总了C#中ImageItem类的典型用法代码示例。如果您正苦于以下问题:C# ImageItem类的具体用法?C# ImageItem怎么用?C# ImageItem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ImageItem类属于命名空间,在下文中一共展示了ImageItem类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Execute
public IList<Shape> Execute(StyleOption option, EffectsDesigner designer, ImageItem source,
Shape imageShape)
{
designer.ApplyPseudoTextWhenNoTextShapes();
if ((option.IsUseBannerStyle
|| option.IsUseFrostedGlassBannerStyle)
&& (option.GetTextBoxPosition() == Position.Left
|| option.GetTextBoxPosition() == Position.Centre
|| option.GetTextBoxPosition() == Position.Right))
{
designer.ApplyTextWrapping();
}
else if (option.IsUseCircleStyle
|| option.IsUseOutlineStyle)
{
designer.ApplyTextWrapping();
}
else
{
designer.RecoverTextWrapping();
}
ApplyTextEffect(option, designer);
designer.ApplyTextGlowEffect(option.IsUseTextGlow, option.TextGlowColor);
return new List<Shape>();
}
示例2: ParseAll
public ImageItemCollection ParseAll(ref string html)
{
ImageItem item;
ImageItemCollection list = null;
MatchCollection mc = FirstStep(ref html);
if (mc.Count < 1)
return null;
List<string> urls = SecondStep(mc);
list = new ImageItemCollection();
foreach(string m in urls)
{
item = new ImageItem(m);
list.Add(item);
string resized = Resize(m);
if (resized != null)
{
item = new ImageItem(resized);
list.Add(item);
}
}
if (list.Count < 1)
return null;
return list;
}
示例3: ApplyStyle
public void ApplyStyle(ImageItem source, Slide contentSlide,
float slideWidth, float slideHeight, StyleOptions option = null)
{
if (Globals.ThisAddIn != null)
{
Globals.ThisAddIn.Application.StartNewUndoEntry();
}
if (option != null)
{
SetStyleOptions(option);
}
// try to use cropped/adjusted image to apply
var fullsizeImage = source.FullSizeImageFile;
source.FullSizeImageFile = source.CroppedImageFile ?? source.FullSizeImageFile;
source.OriginalImageFile = fullsizeImage;
var effectsHandler = new EffectsDesigner(contentSlide,
slideWidth, slideHeight, source);
ApplyStyle(effectsHandler, source, isActualSize: true);
source.FullSizeImageFile = fullsizeImage;
source.OriginalImageFile = null;
}
示例4: Setup
private void Setup(float slideWidth, float slideHeight, ImageItem source)
{
SlideWidth = slideWidth;
SlideHeight = slideHeight;
Source = source;
PrepareShapesForPreview();
}
示例5: Execute
public IList<Shape> Execute(StyleOption option, EffectsDesigner designer, ImageItem source, Shape imageShape, Settings settings)
{
if (option.StyleName != TextCollection.PictureSlidesLabText.StyleNameDirectText
&& option.StyleName != TextCollection.PictureSlidesLabText.StyleNameBlur
&& option.StyleName != TextCollection.PictureSlidesLabText.StyleNameSpecialEffect
&& option.StyleName != TextCollection.PictureSlidesLabText.StyleNameOverlay)
{
designer.ApplyPseudoTextWhenNoTextShapes();
}
if ((option.IsUseBannerStyle
|| option.IsUseFrostedGlassBannerStyle)
&& (option.GetTextBoxPosition() == Position.Left
|| (option.GetTextBoxPosition() == Position.Centre
&& option.GetBannerDirection() != BannerDirection.Horizontal)
|| option.GetTextBoxPosition() == Position.Right))
{
designer.ApplyTextWrapping();
}
else if (option.IsUseCircleStyle
|| option.IsUseOutlineStyle)
{
designer.ApplyTextWrapping();
}
else
{
designer.RecoverTextWrapping(option.GetTextBoxPosition(), option.GetTextAlignment());
}
ApplyTextEffect(option, designer);
designer.ApplyTextGlowEffect(option.IsUseTextGlow, option.TextGlowColor);
return new List<Shape>();
}
示例6: EffectsDesigner
/// <summary>
/// For `preview`
/// </summary>
/// <param name="slide">the temp slide to produce preview image</param>
/// <param name="contentSlide">the slide that contains content</param>
/// <param name="slideWidth"></param>
/// <param name="slideHeight"></param>
/// <param name="source"></param>
private EffectsDesigner(PowerPoint.Slide slide, PowerPoint.Slide contentSlide,
float slideWidth, float slideHeight, ImageItem source)
: base(slide)
{
ContentSlide = contentSlide;
Setup(slideWidth, slideHeight, source);
}
示例7: PreviewApplyStyle
public PreviewInfo PreviewApplyStyle(ImageItem source, Slide contentSlide,
float slideWidth, float slideHeight, StyleOption option)
{
SetStyleOptions(option);
SlideWidth = slideWidth;
SlideHeight = slideHeight;
var previewInfo = new PreviewInfo();
var handler = CreateEffectsHandlerForPreview(source, contentSlide);
// use thumbnail to apply, in order to speed up
var fullSizeImgPath = source.FullSizeImageFile;
var originalThumbnail = source.ImageFile;
source.FullSizeImageFile = null;
source.ImageFile = source.CroppedThumbnailImageFile ?? source.ImageFile;
ApplyStyle(handler, source, isActualSize: false);
// recover the source back
source.FullSizeImageFile = fullSizeImgPath;
source.ImageFile = originalThumbnail;
handler.GetNativeSlide().Export(previewInfo.PreviewApplyStyleImagePath, "JPG",
GetPreviewWidth(), PreviewHeight);
handler.Delete();
return previewInfo;
}
示例8: PreviewApplyStyle
public PreviewInfo PreviewApplyStyle(ImageItem source, Slide contentSlide,
float slideWidth, float slideHeight, StyleOption option)
{
Logger.Log("PreviewApplyStyle begins");
SetStyleOptions(option);
SlideWidth = slideWidth;
SlideHeight = slideHeight;
var previewInfo = new PreviewInfo();
EffectsDesignerForPreview.PreparePreviewing(contentSlide, slideWidth, slideHeight, source);
// use thumbnail to apply, in order to speed up
source.BackupFullSizeImageFile = source.FullSizeImageFile;
var backupImageFile = source.ImageFile;
source.FullSizeImageFile = null;
source.ImageFile = source.CroppedThumbnailImageFile ?? source.ImageFile;
GenerateStyle(EffectsDesignerForPreview, source, isActualSize: false);
// recover the source back
source.FullSizeImageFile = source.BackupFullSizeImageFile;
source.ImageFile = backupImageFile;
EffectsDesignerForPreview.GetNativeSlide().Export(previewInfo.PreviewApplyStyleImagePath, "JPG",
GetPreviewWidth(), PreviewHeight);
Logger.Log("PreviewApplyStyle done");
return previewInfo;
}
示例9: BmtvConfig
public BmtvConfig()
{
Username = new StringItem { Name = "Username" };
Password = new StringItem { Name = "Password" };
CaptchaImage = new ImageItem { Name = "Captcha Image" };
CaptchaText = new StringItem { Name = "Captcha Text" };
}
示例10: Setup
private void Setup(float slideWidth, float slideHeight, ImageItem source)
{
SlideWidth = slideWidth;
SlideHeight = slideHeight;
Source = source;
DeleteShapesWithPrefix(ShapeNamePrefix);
}
示例11: Execute
public IList<Shape> Execute(StyleOption option, EffectsDesigner designer, ImageItem source, Shape imageShape)
{
if (option.IsUseTextBoxStyle)
{
designer.ApplyTextboxEffect(option.TextBoxColor, option.TextBoxTransparency);
}
return new List<Shape>();
}
示例12: ConfigurationDataCaptchaLogin
public ConfigurationDataCaptchaLogin()
{
Username = new StringItem { Name = "Username" };
Password = new StringItem { Name = "Password" };
CaptchaImage = new ImageItem { Name = "Captcha Image" };
CaptchaText = new StringItem { Name = "Captcha Text" };
CaptchaCookie = new HiddenItem("") { Name = "Captcha Cookie" };
}
示例13: Execute
public IList<Shape> Execute(StyleOption option, EffectsDesigner designer, ImageItem source,
Shape imageShape)
{
// store style options information into original image shape
// return original image and cropped image
return designer.EmbedStyleOptionsInformation(
source.OriginalImageFile, source.FullSizeImageFile,
source.ContextLink, source.Rect, option);
}
示例14: PreparePreviewing
public void PreparePreviewing(PowerPoint.Slide contentSlide, float slideWidth, float slideHeight, ImageItem source)
{
Logger.Log("PreparePreviewing begins");
InitLayoutAndDesign(contentSlide);
DeleteAllShapes();
CopyShapes(contentSlide);
Setup(slideWidth, slideHeight, source);
Logger.Log("PreparePreviewing done");
}
示例15: ConfigurationDataCaptchaLogin
/// <param name="instructionMessageOptional">Enter any instructions the user will need to setup the tracker</param>
public ConfigurationDataCaptchaLogin(string instructionMessageOptional = null)
{
Username = new StringItem { Name = "Username" };
Password = new StringItem { Name = "Password" };
CaptchaImage = new ImageItem { Name = "Captcha Image" };
CaptchaText = new StringItem { Name = "Captcha Text" };
CaptchaCookie = new HiddenItem("") { Name = "Captcha Cookie" };
Instructions = new DisplayItem(instructionMessageOptional) { Name = "" };
}