When exporting from presentation graphics files, and when using the pdf2sr
reader to export from PDF files, KeyView can obtain information about the number of images that it would create during export, without having to run a full export. This option uses function pointers that are part of the KVXMLInterfaceEx structure.
To extract image information
fpGetOutputImageInfos()
function. You must pass the return value for this function to the other image functions.fpGetOutputImageCount()
function to get the number of images identified.fpGetOutputImageInfo()
to obtain the image dimensions.fpFreeImageInfos()
.int numberOfImages = 0; void* pImageInfoContext = (*KVXMLInt.fpGetOutputImageInfos)(pContext, &inputStream, &options); if (pImageInfoContext == NULL) { // Error handling code would go here. // fpGetKvErrorCode() could be called here to investigate. } (*KVXMLInt.fpGetOutputImageCount)(pImageInfoContext, &numberOfImages); for (int i = 0; i < numberOfImages; i++) { KVXMLImageInfo imageInfo; KVStructInit(&imageInfo); if ((*KVXMLInt.fpGetOutputImageInfo)(pImageInfoContext, i, &imageInfo)) { // imageInfo.nWidth and imageInfo.nHeight // contain the dimensions at this point. } } (*KVXMLInt.fpFreeImageInfos)(pContext, pImageInfoContext); pImageInfoContext = NULL;
|