Skip to main content
Inspiring
February 3, 2010
Question

CS3 - Vista - SnapshotUtils - Crash

  • February 3, 2010
  • 1 reply
  • 389 views

Hi,

Im using SnapshotUtils to draw a preview of page items. However, I just found out that the following craches on Vista:

//begin snippet

SnapshotUtils ex(pageItemRef,scaling,scaling);

if(ex.GetStatus() == kSuccess) {
     fpCurAGMImage = (AGMImageRecord*)ex.CreateAGMImageAccessor()->GetAGMImageRecord();

     resultOfCreatingPreview = kSuccess;

}

//end snippet

I have no problems on, e.g., XP or OSX, -Any ideas?

Kind regards Toke

This topic has been closed for replies.

1 reply

Bartek_Kropaczewski
Inspiring
February 3, 2010

Hi

Havn't noticed that but i'm using stream for saving page thumbnail to the file

if(kSuccess == ex.GetStatus())    {

     const OSType myFileType = 'JPEG', myCreator = '\?\?\?\?';

     InterfacePtr<IPMStream> myStream(StreamUtil::CreateFileStreamWrite(FileUtils::PMStringToSysFile(myPath), kOpenOut | kOpenTrunc,                     myFileType, myCreator));

     ex.ExportImageToJPEG(myStream, SnapshotUtils::kSSJPEGBaseline, SnapshotUtils::kSSJPEGExcellentQuality);

     myStream->Close();

}

Maybe that will help you (also using Vista)

Regards

Bartek