use of org.apache.poi.ddf.EscherBlipRecord in project poi by apache.
the class HSSFPicture method getPictureData.
/**
* Return picture data for this shape
*
* @return picture data for this shape or {@code null} if picture wasn't embedded, i.e. external linked
*/
@Override
public HSSFPictureData getPictureData() {
int picIdx = getPictureIndex();
if (picIdx == -1) {
return null;
}
HSSFPatriarch patriarch = getPatriarch();
HSSFShape parent = getParent();
while (patriarch == null && parent != null) {
patriarch = parent.getPatriarch();
parent = parent.getParent();
}
if (patriarch == null) {
throw new IllegalStateException("Could not find a patriarch for a HSSPicture");
}
InternalWorkbook iwb = patriarch.getSheet().getWorkbook().getWorkbook();
EscherBSERecord bse = iwb.getBSERecord(picIdx);
EscherBlipRecord blipRecord = bse.getBlipRecord();
return new HSSFPictureData(blipRecord);
}
Aggregations