本文整理汇总了C#中Layout.Render方法的典型用法代码示例。如果您正苦于以下问题:C# Layout.Render方法的具体用法?C# Layout.Render怎么用?C# Layout.Render使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Layout
的用法示例。
在下文中一共展示了Layout.Render方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Render
public void Render(Layout layout, ProviderFactory loader)
{
int resolution = GetValue<int>("resolution");
var size = layout.GetPageSizeInPixels(resolution);
var composed = new Image(size.ToDimensions(), ImageBaseType.Rgb);
if (layout.Render(loader,
new ImageRenderer(layout, composed, resolution)))
;
// Fix me: check next couple of lines!
#if false
DialogState = DialogStateType.SrcImgValid;
else
DialogState = DialogStateType.SrcImgInvalid;
#endif
if (GetValue<bool>("flatten"))
{
composed.Flatten();
}
if (GetValue<int>("color_mode") == 0) // ColorMode.GRAY)
{
composed.ConvertGrayscale();
}
new Display(composed);
Display.DisplaysFlush();
}
示例2: GetLayoutBytes
/// <summary>
/// The sequence of <see langword="byte"/> to be written in a file after applying any formating and any
/// transformations required from the <see cref="Layout"/>.
/// </summary>
/// <param name="layout">The layout used to render output message.</param>
/// <returns>Sequence of <see langword="byte"/> to be written.</returns>
/// <remarks>Usually it is used to render the header and hooter of the files.</remarks>
private byte[] GetLayoutBytes(Layout layout)
{
if (layout == null)
{
return null;
}
string renderedText = layout.Render(LogEventInfo.CreateNullEvent()) + this.NewLineChars;
return this.TransformBytes(this.Encoding.GetBytes(renderedText));
}