本文整理匯總了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);
}