public abstract class PictureRef extends Object
CreatePictureFragment
Constructor and Description |
---|
PictureRef() |
Modifier and Type | Method and Description |
---|---|
static PictureRef |
create(Attachment attachment,
AttachmentResolver resolver)
Returns a reference to the picture contained in the specified attachment.
|
static PictureRef |
create(File file)
Returns a reference to the picture contained in the specified file.
|
static PictureRef |
create(com.sodius.mdw.corext.model.ImportedImage image)
Returns a reference to the picture contained in the specified
ImportedImage instance. |
public static PictureRef create(File file)
file
- the file which contains picture data.public static PictureRef create(com.sodius.mdw.corext.model.ImportedImage image)
ImportedImage
instance.
An ImportedImage
can typically be used to hold the content of an image stored on an DOORS EMF Object, as in the example below:
com.sodius.mdw.metamodel.doors.Object myObject = ...; String imageContent = myObject.getImage(); if (imageContent != null && ! imageContent.isEmpty()) { ImportedImage image = ImportedImage.read(imageContent, null); PictureRef picture = PictureRef.create(image); }
image
- the image data of the picture.public static PictureRef create(Attachment attachment, AttachmentResolver resolver)
attachment
- a logical reference to an attachment.resolver
- the resolver which enables to get access to the bytes of the logical attachment.