Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Picture to JPEG on Windows



Hi all.

I'm using the following (abbreviated) code to convert a Picture in memory to compressed JPEG format:

UInt32 convertToJPEG(PicHandle source,Handle dest, CodecQ quality)
{
  OSErr osErr;
  ComponentResult cResult;
  GraphicsExportComponent graphicsExporter;
  UInt32 jpegBytesLength=0;

osErr=OpenADefaultComponent(GraphicsExporterComponentType,'JPEG',&graphi csExporter);
cResult=GraphicsExportSetInputPicture(graphicsExporter,source);
cResult=GraphicsExportSetOutputHandle(graphicsExporter,dest);
cResult=GraphicsExportSetCompressionQuality(graphicsExporter,quality);
cResult=GraphicsExportDoExport(graphicsExporter,&jpegBytesLength);
return jpegBytesLength;
}


source is a valid Picture, and dest is a freshly allocated handle created via dest=NewHandle(0) - the export operation resizes accordingly.

This works great on Mac, but on Windows GraphicsExportDoExport returns -50 (bad parameter error).
Any ideas what the problem could be?


TIA
Ian

_______________________________________________
Do not post admin requests to the list. They will be ignored.
QuickTime-API mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quicktime-api/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.