TrophyCustomer's Canvas is honored with a 2020 InterTech Technology Award! Learn more 

RenderHiRes Method (PrintArea, RenderingConfig)

Renders a PrintArea to the cache.

Generates an image ID in the cache, which represents the hi-res output for the specified PrintArea.

Namespace: Aurigma.DesignAtoms.Rendering
Assembly: Aurigma.DesignAtoms (in Aurigma.DesignAtoms.dll)

Syntax

C#
public string RenderHiRes(
	PrintArea printArea,
	RenderingConfig renderingConfig
)

Parameters

printArea

Type: Aurigma.DesignAtoms.Model.PrintArea

A PrintArea to render.
renderingConfig

Type: Aurigma.DesignAtoms.Configuration.RenderingConfig.RenderingConfig

Rendering properties. When you skip this parameter or pass null, the dafault configuration is applied.

Return Value

An ID of the hi-res output for the specified PrintArea. To retrieve the image by ID, you can use the GetReadStream() method.

Examples

C#
// Create a print area.
var product = new Product();
var surface = new Surface(330, 600);
product.Surfaces.Add(surface);
var printArea = new PrintArea(new RectangleF(0, 0, surface.Width, surface.Height));
surface.PrintAreas.Add(printArea);

// Instantiate IProductRenderer.
var renderer = Injector.Instance.Resolve<IProductRenderer>();
// Get the identifier of the rendered print area.
var cacheId = renderer.RenderHiRes(printArea);

// Instantiate IFileCache to retrieve the hi-res output.
var fileCache = Injector.Instance.Resolve<IFileCache>();
// Save the hi-res output to a file.
using (var stream = fileCache.GetReadStream(cacheId))
using (var fileStream = File.Create("printarea.pdf"))
    stream.CopyTo(fileStream);

See Also

Reference