public final class Metafile extends Image
Defines a graphic metafile. A metafile contains records that describe a sequence of graphics operations that can be recorded (constructed) and played back (displayed). This class is not inheritable.
Image.GetThumbnailImageAbort| Constructor and Description |
|---|
Metafile(byte[] henhmetafile,
boolean deleteEmf)
Initializes a new instance of the
Metafile class from the specified handle. |
Metafile(byte[] referenceHdc,
int emfType)
|
Metafile(InputStream stream)
Initializes a new instance of the
Metafile class from the specified data stream. |
Metafile(InputStream stream,
byte[] referenceHdc)
Initializes a new instance of the
Metafile class from the specified
data stream and a Windows handle to a device context. |
Metafile(InputStream stream,
byte[] referenceHdc,
int type)
|
Metafile(InputStream stream,
byte[] referenceHdc,
RectangleF frameRect,
int frameUnit,
int type)
|
Metafile(com.aspose.ms.System.IO.Stream stream,
int type)
Initializes a new instance of the
Metafile class from the specified
data stream and a Windows handle to a device context. |
Metafile(String filename)
Initializes a new instance of the
Metafile class from the specified file name. |
Metafile(String filename,
byte[] referenceHdc)
Initializes a new instance of the
Metafile class from the specified file name. |
| Modifier and Type | Method and Description |
|---|---|
UUID[] |
getFrameDimensionsList()
Gets an array of GUIDs that represent the dimensions of frames within this
Image. |
int |
getHeight()
Gets the height, in pixels, of this
Metafile. |
com.aspose.ms.System.IntPtr |
getHenhmetafile()
Returns a Windows handle to an enhanced
Metafile. |
MetafileHeader |
getMetafileHeader()
Returns the
MetafileHeader associated with this Metafile. |
static MetafileHeader |
getMetafileHeader(InputStream stream)
Returns the
MetafileHeader associated with the specified Metafile. |
static MetafileHeader |
getMetafileHeader(String fileName)
Returns the
MetafileHeader associated with the specified Metafile. |
ColorPalette |
getPalette()
Gets or sets the color palette used for this
Image. |
int |
getPixelFormat()
Gets the pixel format for this
Image. |
int[] |
getPropertyIdList()
Gets IDs of the property items stored in this
Image. |
PropertyItem |
getPropertyItem(int propid)
Gets the specified property item from this
Image. |
PropertyItem[] |
getPropertyItems()
Gets all the property items (pieces of metadata) stored in this
Image. |
ImageFormat |
getRawFormat()
Gets the file format of this
Image. |
int |
getWidth()
Gets the width, in pixels, of this
Metafile. |
void |
playRecord(int recordType,
int flags,
int dataSize,
byte[] dataArray)
Plays an individual metafile record.
|
void |
removePropertyItem(int propid)
Removes the specified property item from this
Image. |
void |
rotateFlip(int rotateFlipType)
This method rotates, flips, or rotates and flips the
Image. |
void |
setPalette(ColorPalette value)
Gets or sets the color palette used for this
Image. |
void |
setPropertyItem(PropertyItem propitem)
Stores a property item (piece of metadata) in this
Image. |
deepClone, dispose, fromFile, fromHbitmap, fromStream, fromStream, getBounds, getFlags, getFrameCount, getHorizontalResolution, getPhysicalDimension, getPixelFormatSize, getSize, getTag, getThumbnailImage, getVerticalResolution, isAlphaPixelFormat, save, save, save, save, save, saveAdd, saveAdd, selectActiveFrame, setTagpublic Metafile(byte[] henhmetafile,
boolean deleteEmf)
Initializes a new instance of the Metafile class from the specified handle.
henhmetafile - A handle to an enhanced metafile.deleteEmf - true to delete the enhanced metafile handle when
the Metafile is deleted; otherwise, false.public Metafile(byte[] referenceHdc,
int emfType)
public Metafile(String filename)
Initializes a new instance of the Metafile class from the specified file name.
public Metafile(String filename, byte[] referenceHdc)
Initializes a new instance of the Metafile class from the specified file name.
public Metafile(InputStream stream)
Initializes a new instance of the Metafile class from the specified data stream.
stream - The InputStream from which to create
the new Metafile.public Metafile(InputStream stream, byte[] referenceHdc)
Initializes a new instance of the Metafile class from the specified
data stream and a Windows handle to a device context. />.
stream - A InputStream that contains the data for
this Metafile.referenceHdc - A Windows handle to a device context of the Metafile object.public Metafile(com.aspose.ms.System.IO.Stream stream,
int type)
Initializes a new instance of the Metafile class from the specified
data stream and a Windows handle to a device context. />.
stream - A InputStream that contains the data for
this Metafile.type - must be int 1.public Metafile(InputStream stream, byte[] referenceHdc, int type)
Initializes a new instance of the Metafile class from the specified
data stream, a Windows handle to a device context, and an EmfType enumeration
that specifies the format of the Metafile.
stream - A InputStream that contains the data for
this Metafile.referenceHdc - A Windows handle to a device context.type - An EmfType that specifies the format
of the Metafile.public Metafile(InputStream stream, byte[] referenceHdc, RectangleF frameRect, int frameUnit, int type)
Initializes a new instance of the Metafile class from the specified
data stream, a Windows handle to a device context, and an EmfType enumeration
that specifies the format of the Metafile.
stream - A InputStream that contains the data for
this Metafile.referenceHdc - A Windows handle to a device context.frameRect - A Rectangle that represents the rectangle that bounds the new Metafile.frameUnit - A MetafileFrameUnit that specifies the unit of measure for frameRect.type - An EmfType that specifies the format
of the Metafile.public int getWidth()
Gets the width, in pixels, of this Metafile.
public int getHeight()
Gets the height, in pixels, of this Metafile.
public ImageFormat getRawFormat()
Gets the file format of this Image.
getRawFormat in class ImageImageFormat that represents the file format of this Image.public int getPixelFormat()
Gets the pixel format for this Image.
getPixelFormat in class ImagePixelFormat(Image.getPixelFormat()) that represents the pixel format for this Image.public ColorPalette getPalette()
Gets or sets the color palette used for this Image.
getPalette in class ImageColorPalette that represents the color palette used for this Image.public void setPalette(ColorPalette value)
Gets or sets the color palette used for this Image.
setPalette in class Imagepublic UUID[] getFrameDimensionsList()
Gets an array of GUIDs that represent the dimensions of frames within this Image.
getFrameDimensionsList in class ImageImage
from most significant to least significant.public int[] getPropertyIdList()
Gets IDs of the property items stored in this Image.
getPropertyIdList in class Imagepublic PropertyItem[] getPropertyItems()
Gets all the property items (pieces of metadata) stored in this Image.
getPropertyItems in class ImagePropertyItem objects, one for each property item stored in the image.public static MetafileHeader getMetafileHeader(InputStream stream)
Returns the MetafileHeader associated with the specified Metafile.
stream - A InputStream containing the Metafile for which a header is retrieved.MetafileHeader associated with the specified Metafile.public static MetafileHeader getMetafileHeader(String fileName)
Returns the MetafileHeader associated with the specified Metafile.
fileName - A String containing the name of the Metafile for which a header is retrieved.MetafileHeader associated with the specified Metafile.public void rotateFlip(int rotateFlipType)
This method rotates, flips, or rotates and flips the Image.
rotateFlip in class ImagerotateFlipType - A RotateFlipType member that specifies the type of rotation
and flip to apply to the image.public com.aspose.ms.System.IntPtr getHenhmetafile()
Returns a Windows handle to an enhanced Metafile.
Metafile.public void playRecord(int recordType,
int flags,
int dataSize,
byte[] dataArray)
Plays an individual metafile record.
recordType - Element of the EmfPlusRecordType that specifies the type of metafile record being played.flags - A set of flags that specify attributes of the record.dataSize - The number of bytes in the record data.dataArray - An array of bytes that contains the record data.public MetafileHeader getMetafileHeader()
Returns the MetafileHeader associated with this Metafile.
MetafileHeader associated with this Metafile.public PropertyItem getPropertyItem(int propid)
Gets the specified property item from this Image.
getPropertyItem in class Imagepropid - The ID of the property item to get.PropertyItem this method gets.public void removePropertyItem(int propid)
Removes the specified property item from this Image.
removePropertyItem in class Imagepropid - The ID of the property item to remove.public void setPropertyItem(PropertyItem propitem)
Stores a property item (piece of metadata) in this Image.
setPropertyItem in class Imagepropitem - The PropertyItem to be stored.Copyright (c) 2008-2025 Aspose Pty Ltd. All Rights Reserved.