Renders a Surface to a Stream.
Namespace:
Aurigma.DesignAtoms.Rendering
Assembly:
Aurigma.DesignAtoms (in Aurigma.DesignAtoms.dll)
void RenderProof( Stream stream, Surface surface, RenderingConfig renderingConfig, Nullable<Size> maxSize, Nullable<ResizeMode> resizeMode )
Type: System.IO.Stream
Type: Aurigma.DesignAtoms.Model.Surface
A Surface to render.Type: Aurigma.DesignAtoms.Configuration.RenderingConfig.RenderingConfig
Rendering properties. You can passnull
to use the dafault configuration.Type: System.Nullable<Size>
The width and height of the rendered proof image, in pixels. By default, proof images are 500 x 500 pixels.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.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); }