views:

35

answers:

2

I am trying to use the Image Capture API to grab pictures from a camera. The header file mentions a kRotateImage flag and a rotationAngle parameter for the ICADownloadFile function. I cannot get this to work however. The API seems just to ignore my requests. Anyone know if this is a known problem or if I am doing something wrong?

Here is a snippet from my program:

ICADownloadFilePB pb = {};
pb.object        = [[picInfo objectForKey:@"icao"] longValue];
pb.dirFSRef      = &downloadFolderFSRef;     
pb.rotationAngle = FloatToFixed(90.0);  // edit
pb.flags         = kAdjustCreationDate | kRotateImage;
ICADownloadFile(&pb, getDownloadCallback);
+1  A: 

rotationAngle is not of type int; it's a "fixed" data type. Definition:

This data type uses a 16-bit signed integer and a 16-bit fraction to represent fixed-point decimal numbers...

Try this instead:

pb.rotationAngle = FloatToFixed(90.0);
Diederik Hoogenboom
Thanks. Unfortunately that didn't work either.
staffan
A: 

The documentation says that this parameter is "rotation angle in steps of 90 degrees" (http://developer.apple.com/mac/library/documentation/GraphicsImaging/Reference/ImageCaptureServicesRef/ICAApplication%5Fh/index.html#//apple%5Fref/c/tdef/ICADownloadFilePB).

So try:

pb.rotationAngle = FloatToFixed(1.0f);
natevw