本文整理汇总了C#中Block.InsertImage方法的典型用法代码示例。如果您正苦于以下问题:C# Block.InsertImage方法的具体用法?C# Block.InsertImage怎么用?C# Block.InsertImage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Block
的用法示例。
在下文中一共展示了Block.InsertImage方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreatePageWithImage
private void CreatePageWithImage(RadFixedDocument document, string imageExtension, EncodedImageData imageData)
{
RadFixedPage page = document.Pages.AddPage();
page.Size = PageSize;
FixedContentEditor editor = new FixedContentEditor(page);
editor.Position.Translate(Margins.Left, Margins.Top);
Block block = new Block();
block.HorizontalAlignment = Telerik.Windows.Documents.Fixed.Model.Editing.Flow.HorizontalAlignment.Center;
block.TextProperties.FontSize = 22;
block.InsertText(string.Format("This is {0} image in {1} color space encoded with {2} filter.", imageExtension, imageData.ColorSpace, imageData.Filters.FirstOrDefault() ?? "None"));
Size blockSize = block.Measure(RemainingPageSize);
editor.DrawBlock(block, RemainingPageSize);
editor.Position.Translate(Margins.Left, blockSize.Height + Margins.Top + 50);
Block imageBlock = new Block();
imageBlock.HorizontalAlignment = Telerik.Windows.Documents.Fixed.Model.Editing.Flow.HorizontalAlignment.Center;
imageBlock.InsertImage(new ImageSource(imageData), new Size(imageData.Width, imageData.Height));
editor.DrawBlock(imageBlock, RemainingPageSize);
}
示例2: AddPageWithImage
private void AddPageWithImage(string description, ImageSource imageSource)
{
RadFixedPage page = this.document.Pages.AddPage();
page.Size = PageSize;
FixedContentEditor editor = new FixedContentEditor(page);
editor.GraphicProperties.FillColor = new RgbColor(200, 200, 200);
editor.DrawRectangle(new Rect(0, 0, PageSize.Width, PageSize.Height));
editor.Position.Translate(Margins.Left, Margins.Top);
Block block = new Block();
block.HorizontalAlignment = Telerik.Windows.Documents.Fixed.Model.Editing.Flow.HorizontalAlignment.Center;
block.TextProperties.FontSize = 22;
block.InsertText(description);
Size blockSize = block.Measure(RemainingPageSize);
editor.DrawBlock(block, RemainingPageSize);
editor.Position.Translate(Margins.Left, blockSize.Height + Margins.Top + 20);
Block imageBlock = new Block();
imageBlock.HorizontalAlignment = Telerik.Windows.Documents.Fixed.Model.Editing.Flow.HorizontalAlignment.Center;
imageBlock.InsertImage(imageSource);
editor.DrawBlock(imageBlock, RemainingPageSize);
}