public class DgnImage extends Image implements IHasEntities<DgnDrawableEntityBase>, IHasLayouts<IDrawingLayout<DgnDrawableEntityBase>,DgnDrawableEntityBase>
Dgn image class
| Modifier and Type | Method and Description |
|---|---|
void |
cacheData()
Caches the data and ensures no additional data loading will be performed from the underlying
DataStreamSupporter.DataStreamContainer. |
int |
getDepth()
Gets the image depth.
|
List<DgnDrawableEntityBase> |
getEntities()
<inheritdoc></inheritdoc> |
int |
getHeight()
Gets the image height.
|
boolean |
getIs3DImage()
Gets a value indicating whether file is 3D or not
|
LinkedHashMap<String,IDrawingLayout<DgnDrawableEntityBase>> |
getLayouts()
Gets the layouts map.
|
Cad3DPoint |
getMaxPoint()
Gets the max point.
|
Cad3DPoint |
getMinPoint()
Gets the min point.
|
String[] |
getStrings()
Gets all string values from image.
|
UnitType |
getSubUnitType()
Gets current sub-unit type.
|
DgnElementBase[] |
getTags()
Gets the tags.
|
DgnFileVersion |
getVersion()
Gets DGN version of loaded image
|
DgnViewInfo[] |
getViews()
Gets the views.
|
int |
getWidth()
Gets the image width.
|
boolean |
isCached()
Gets a value indicating whether object's data is cached currently and no data reading is required.
|
void |
tryRemoveEntity(DgnDrawableEntityBase entityToRemove)
<inheritdoc></inheritdoc> |
canLoad, canLoad, canLoad, canLoad, canSave, getAnnotationService, getBounds, getContainer, getCustomProperties, getFileFormat, getFileFormat, getPalette, getSize, getUnitlessDefaultUnitType, getUnitType, getWatermarkGuardService, load, load, load, load, load, save, save, save, setPalettegetDataStreamContainer, save, save, save, saveclose, dispose, getDisposedpublic final LinkedHashMap<String,IDrawingLayout<DgnDrawableEntityBase>> getLayouts()
Gets the layouts map.
getLayouts in interface IHasLayouts<IDrawingLayout<DgnDrawableEntityBase>,DgnDrawableEntityBase>public final List<DgnDrawableEntityBase> getEntities()
<inheritdoc></inheritdoc>getEntities in interface IHasEntities<DgnDrawableEntityBase>public final void tryRemoveEntity(DgnDrawableEntityBase entityToRemove)
<inheritdoc></inheritdoc>tryRemoveEntity in interface IHasEntities<DgnDrawableEntityBase>entityToRemove - Entity to removepublic UnitType getSubUnitType()
Gets current sub-unit type.
public final boolean isCached()
Gets a value indicating whether object's data is cached currently and no data reading is required.
isCached in class DataStreamSupportertrue if object's data is cached; otherwise, false.public DgnFileVersion getVersion()
Gets DGN version of loaded image
public boolean getIs3DImage()
Gets a value indicating whether file is 3D or not
public int getWidth()
Gets the image width.
Defines the X-axis distance between the leftmost point of all graphic objects in the image and their rightmost point.
The distance is measured in units corresponding to the value of the property Image.UnitType(Image#getUnitType)
Value: The image width.Uses image width value to set rasterization options.string fileName = "ExampleFile; string file = string.Format("{0}.dgn", fileName); string outPath = string.Format("{0}.pdf", fileName); using (FileStream inStream = new FileStream(file, FileMode.Open)) using (DgnImage image = (DgnImage) Image.Load(inStream)) { CadRasterizationOptions rasterizationOptions = new CadRasterizationOptions(); rasterizationOptions.PageSize = new SizeF(image.Width, image.Height); rasterizationOptions.PageHeight = image.Height; rasterizationOptions.PageWidth = image.Width; rasterizationOptions.UnitType = image.UnitType; PdfOptions pdfOptions = new PdfOptions { VectorRasterizationOptions = rasterizationOptions }; image.Save(outPath, pdfOptions); }
getWidth in interface IObjectWithBoundsgetWidth in class Imagepublic int getHeight()
Gets the image height.
Defines the Y-axis distance between the bottommost point of all graphical objects in the image and their topmost point.
The distance is measured in units corresponding to the value of the property Image.UnitType(Image#getUnitType)
Value: The image height.Uses image height value to set rasterization options.string fileName = "ExampleFile; string file = string.Format("{0}.dgn", fileName); string outPath = string.Format("{0}.pdf", fileName); using (FileStream inStream = new FileStream(file, FileMode.Open)) using (DgnImage image = (DgnImage) Image.Load(inStream)) { CadRasterizationOptions rasterizationOptions = new CadRasterizationOptions(); rasterizationOptions.PageSize = new SizeF(image.Width, image.Height); rasterizationOptions.PageHeight = image.Height; rasterizationOptions.PageWidth = image.Width; rasterizationOptions.UnitType = image.UnitType; PdfOptions pdfOptions = new PdfOptions { VectorRasterizationOptions = rasterizationOptions }; image.Save(outPath, pdfOptions); }
getHeight in interface IObjectWithBoundsgetHeight in class Imagepublic int getDepth()
Gets the image depth.
Value: The image depth.Prints drawing's depthImage drawing = ... System.Console.WriteLine("Drawing's depth: " + drawing.Depth);
public final DgnElementBase[] getTags()
Gets the tags.
public Cad3DPoint getMaxPoint()
Gets the max point.
public Cad3DPoint getMinPoint()
Gets the min point.
public final DgnViewInfo[] getViews()
Gets the views.
public final void cacheData()
Caches the data and ensures no additional data loading will be performed from the underlying DataStreamSupporter.DataStreamContainer.
cacheData in class DataStreamSupporterpublic String[] getStrings()
Gets all string values from image.
getStrings in class ImageCopyright (c) 2008-2025 Aspose Pty Ltd. All Rights Reserved.