Class ObjImage

ObjImage class

Represents an image in OBJ format. Contains information about bounds of the drawing, materials, vertices, and shapes. Each shape contains information about set of faces with corresponding material, vertex, texture, and normal indices.

public class ObjImage : Image

Constructors

NameDescription
ObjImage(ObjRoot)Initializes a new instance of the ObjImage class.

Properties

NameDescription
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 depth of the image. Calculated as the difference between maximum and minimum values of the Z coordinate amongst all vertices. Minimal allowed depth is 0.
Disposed { get; }Gets a value indicating whether this instance is disposed.
override Height { get; }Gets the height of the image. Calculated as the difference between maximum and minimum values of the Y coordinate amongst all vertices. Minimal allowed height is 1.
override IsCached { get; }Gets a value indicating whether object’s data is cached currently and no data reading is required.
ObjRoot { get; set; }Gets or sets root information about the drawing. ObjRoot contains data about vertices, materials, and shapes. Could be useful for the exposing information about faces.
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 width of the image. Calculated as the difference between maximum and minimum values of the X coordinate amongst all vertices. Minimal allowed width is 1.

Methods

NameDescription
override CacheData()Caches the data and ensures no additional data loading will be performed from the underlying DataStreamContainer. Not implemented.
CanSave(ImageOptionsBase)Determines whether image can be saved to the specified file format represented by the passed save options.
Dispose()Disposes the current instance.
GetShapes()Gets data about drawable shapes for OBJ image. Each shape contains information about its name, material and faces. ObjFace includes data about correspoinding vertex, texture, and normal indices.
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

Examples

Loading of the drawing in OBJ format.

using (ObjImage objImage = (ObjImage)Image.Load(fileName))
{
...
}

See Also