Class ThreeDSImage

ThreeDSImage class

3DS image class. Allows to load 3D models from 3DS files. In example below 3D model loaded from file and exported to PDF. The resulting PDF file will contain projection of 3D model occupying the entire page with margins.

public class ThreeDSImage : Image

Constructors

NameDescription
ThreeDSImage()The default constructor.

Properties

NameDescription
AmbientLight { get; set; }The ambient light color.
virtual AnnotationService { get; }Gets the annotation service.
Bounds { get; }Gets the image bounds.
Container { get; }Gets the Image container.
virtual CustomProperties { get; }Gets or sets the custom properties.
DataStreamContainer { get; }Gets the object’s data stream.
override Depth { get; }Gets the image depth.
Disposed { get; }Gets a value indicating whether this instance is disposed.
HasMaterials { get; }Gets a value indicating whether object has materials.
HasMeshes { get; }Gets a value indicating whether object has meshes.
override Height { get; }Gets the image height.
override IsCached { get; }Gets a value indicating whether object’s data is cached currently and no data readig is required.
Materials { get; }The list of the materials.
Meshes { get; }The list of the meshes.
Palette { get; set; }Gets or sets the color palette.
Size { get; }Gets the image size.
virtual UnitlessDefaultUnitType { get; }Assumed unit type when UnitType is set to Unitless
virtual UnitType { get; }Gets current unit type.
virtual WatermarkGuardService { get; }
override Width { get; }Gets the image width.

Methods

NameDescription
override CacheData()Caches the data and ensures no additional data loading will be performed from the underlying DataStreamContainer.
CanSave(ImageOptionsBase)Determines whether image can be saved to the specified file format represented by the passed save options.
Dispose()Disposes the current instance.
virtual GetStrings()Gets all string values from image.
Save()Saves the image data to the underlying stream.
Save(Stream)Saves the object’s data to the specified stream.
virtual Save(string)Saves the object’s data to the specified file location.
Save(Stream, ImageOptionsBase)Saves the image’s data to the specified stream in the specified file format according to save options.
virtual Save(string, bool)Saves the object’s data to the specified file location.
virtual Save(string, ImageOptionsBase)Saves the object’s data to the specified file location in the specified file format according to save options.
SaveAsync(Stream, ImageOptionsBase)Saves the image’s data to the specified stream in the specified file format according to save options.
virtual SaveAsync(string, ImageOptionsBase)Saves the object’s data to the specified file location in the specified file format according to save options.
virtual ThrowIfCantExportToCad(ImageOptionsBase, Exception)Throw exception if can`t export
UpdateImage()

Examples

Loading of 3DS model and exporting of ThreeDSImage into PDF document of desired size.

using (ThreeDSImage image = (ThreeDSImage)Image.Load(inFileName))
{
    PdfOptions pdfOptions = new PdfOptions();
    var rasterizationOptions = new CadRasterizationOptions();
    rasterizationOptions.PageWidth = 1600; 
    rasterizationOptions.PageHeight = 1600; 
    pdfOptions.VectorRasterizationOptions = rasterizationOptions;
    image.Save(outFileName, pdfOptions);
}

See Also