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

RenderProof Method (Stream, Surface, RenderingConfig, Nullable(Size), Nullable())

Renders a Surface to a Stream.

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

Syntax

C#
void RenderProof(
	Stream stream,
	Surface surface,
	RenderingConfig renderingConfig,
	Nullable<Size> maxSize,
	Nullable<ResizeMode> resizeMode
)

Parameters

stream

Type: System.IO.Stream

surface

Type: Aurigma.DesignAtoms.Model.Surface

A Surface to render.
renderingConfig

Type: Aurigma.DesignAtoms.Configuration.RenderingConfig.RenderingConfig

Rendering properties. You can pass null to use the dafault configuration.
maxSize

Type: System.Nullable<Size>

The width and height of the rendered proof image, in pixels. By default, proof images are 500 x 500 pixels.
resizeMode

Type: System.Nullable<ResizeMode>

Defines how the proof image should appear in the specified bounds. For the values, you can refer to the ResizeMode enumeration.

Examples

C#
using Aurigma.GraphicsMill.Codecs;
using Aurigma.DesignAtoms.Configuration.RenderingConfig;
using Aurigma.DesignAtoms.Rendering;

// Create the output file.
using (var fileStream = File.Create("thumbnail.jpg"))
{
    // Read the default rendering config.
    var config = RenderingConfig.GetDefault();
    // Set the JPEG image format.
    config.DefaultProofRendering.FileFormat = FileFormat.Jpeg;
    // Set the new image size.
    var maxSize = new Size(300, 300);

    // Instantiate IProductRenderer and render the first product page.
    var renderer = Injector.Instance.Resolve<IProductRenderer>();
    renderer.RenderProof(fileStream, product.Surfaces.First(), config, maxSize);
}

See Also

Reference

Manual