Package org.apache.poi.hssf.usermodel
Class HSSFPictureData
- java.lang.Object
-
- org.apache.poi.hssf.usermodel.HSSFPictureData
-
- All Implemented Interfaces:
PictureData
public class HSSFPictureData extends Object implements PictureData
Represents binary data stored in the file. Eg. A GIF, JPEG etc...
-
-
Field Summary
Fields Modifier and Type Field Description static short
FORMAT_MASK
static short
MSOBI_DIB
static short
MSOBI_EMF
static short
MSOBI_JPEG
static short
MSOBI_PICT
static short
MSOBI_PNG
static short
MSOBI_WMF
-
Constructor Summary
Constructors Constructor Description HSSFPictureData(EscherBlipRecord blip)
Constructs a picture object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]
getData()
Gets the picture data.int
getFormat()
String
getMimeType()
Returns the mime type for the imageint
getPictureType()
String
suggestFileExtension()
Suggests a file extension for this image.
-
-
-
Field Detail
-
MSOBI_WMF
public static final short MSOBI_WMF
- See Also:
- Constant Field Values
-
MSOBI_EMF
public static final short MSOBI_EMF
- See Also:
- Constant Field Values
-
MSOBI_PICT
public static final short MSOBI_PICT
- See Also:
- Constant Field Values
-
MSOBI_PNG
public static final short MSOBI_PNG
- See Also:
- Constant Field Values
-
MSOBI_JPEG
public static final short MSOBI_JPEG
- See Also:
- Constant Field Values
-
MSOBI_DIB
public static final short MSOBI_DIB
- See Also:
- Constant Field Values
-
FORMAT_MASK
public static final short FORMAT_MASK
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
HSSFPictureData
public HSSFPictureData(EscherBlipRecord blip)
Constructs a picture object.- Parameters:
blip
- the underlying blip record containing the bitmap data.
-
-
Method Detail
-
getData
public byte[] getData()
Description copied from interface:PictureData
Gets the picture data.- Specified by:
getData
in interfacePictureData
- Returns:
- the picture data.
-
getFormat
public int getFormat()
- Returns:
- format of the picture.
- See Also:
Workbook.PICTURE_TYPE_DIB
,Workbook.PICTURE_TYPE_WMF
,Workbook.PICTURE_TYPE_EMF
,Workbook.PICTURE_TYPE_PNG
,Workbook.PICTURE_TYPE_JPEG
,Workbook.PICTURE_TYPE_PICT
-
suggestFileExtension
public String suggestFileExtension()
Description copied from interface:PictureData
Suggests a file extension for this image.- Specified by:
suggestFileExtension
in interfacePictureData
- Returns:
- 'wmf', 'jpeg' etc depending on the format. never
null
- See Also:
getFormat()
-
getMimeType
public String getMimeType()
Description copied from interface:PictureData
Returns the mime type for the image- Specified by:
getMimeType
in interfacePictureData
-
getPictureType
public int getPictureType()
- Specified by:
getPictureType
in interfacePictureData
- Returns:
- the POI internal image type, 0 if unknown image type (was -1 prior to 5.0.0 but
that was inconsistent with other
PictureData
implementations) - See Also:
Workbook.PICTURE_TYPE_DIB
,Workbook.PICTURE_TYPE_EMF
,Workbook.PICTURE_TYPE_JPEG
,Workbook.PICTURE_TYPE_PICT
,Workbook.PICTURE_TYPE_PNG
,Workbook.PICTURE_TYPE_WMF
-
-