docexample_extractimage.cpp

00001 #include <sstream>
00002 
00003 #include "NOPackage.h"
00004 #include "NOPage.h"
00005 
00006 using namespace NiXPSObjects;
00007 
00008 void extractImage()
00009 {
00010         NOPackage *baseDoc = NOPackage::readPackageFromFile("CoreProperty2.xps");
00011         
00012         // get the second document, the second paged (0-based index!)
00013         NOPage basePage = baseDoc->getDocument(1).getPage(1);
00014 
00015         NOImageVector lImages(*baseDoc);
00016         UInt32 numberOfImages = basePage.getImages(lImages);
00017 
00018         // write out the fourth image to a file
00019         int i = 0;
00020         for (; i < numberOfImages; i++)
00021         {
00022                 std::stringstream so;
00023                 so << "imagefile " << i;
00024                 NOImage lImage = lImages[i];
00025                 lImage.writeImageToFile(so.str());
00026         }
00027 }

Generated on Thu Jul 19 09:33:08 2007 for NiXPS Library by  doxygen 1.5.2