I'm still looking ito exactly what they mean by all of this :-)
...it's not the most clearly worded of statements, especially as the libraries themselves are not actually mentioned in the doumentation at all...


... I have access to both pieces of hardware and will report !

...but right now I havea bit of a problem. If anyone can help with this one...

I'm trying to use the libs to display a (roughly) 320x320 jpeg on a 16 bit display. Here is the function I'm using:

The symptom is that the colors look like the palette is messed up. The screen is set up in 16 bit mode as well.
Anybody see anything I'm missing?


PS. The freeware jpeglib works fine... I must be missing something...

WinHandle
Drawing::LoadJPG (Char* file)
{
   BitmapTypeV3* b3;
   BitmapPtr b;
   Err error;
   UInt16 jpegLibRef = 0;
   UInt16 volRefNum;
   UInt32 volIterator;
   WinHandle img;

   PalmPhotoDisplayParam displayParam;
   PalmPhotoFileLocation photoFile;
   PalmPhotoHandle photoHandle = 0;
   PalmPhotoImageInfo photoInfo;
   WinHandle img2;

error = SysLibFind(PalmPhotoLibName, &jpegLibRef);
if (error != errNone)
error = SysLibLoad(PalmPhotoLibTypeID, PalmPhotoLibCreatorID, &jpegLibRef);
if (error == errNone)
PalmPhotoLibOpen(jpegLibRef);
else
goto ErrorExit;


   volIterator = vfsIteratorStart;
   error = VFSVolumeEnumerate(&volRefNum, &volIterator);
   if (error != errNone)
       goto ErrorExit;

photoFile.fileLocationType = palmPhotoVFSLocation;
photoFile.file.VFSFile.volumeRef = volRefNum;
StrCopy(photoFile.file.VFSFile.name, file);
photoHandle = PalmPhotoOpenImage(jpegLibRef, &photoFile, &error);
if (error != errNone)
goto ErrorExit;
error = PalmPhotoGetImageInfo(jpegLibRef, photoHandle, &photoInfo);
if (error)
goto ErrorExit;


b = BmpCreate(photoInfo.width, photoInfo.height, 16, NULL, &error);
if (error != errNone)
goto ErrorExit;
b3 = BmpCreateBitmapV3(b, kDensityDouble, BmpGetBits(b), NULL);
img = WinCreateBitmapWindow((BitmapPtr) b, &error);
if (error != errNone)
goto ErrorExit;
displayParam.winH = img;
displayParam.rect.topLeft.x = 0;
displayParam.rect.topLeft.y = 0;
displayParam.rect.extent.x = photoInfo.width;
displayParam.rect.extent.y = photoInfo.height;
displayParam.displayCallback = NULL;
displayParam.userDataP = NULL;
error = PalmPhotoDisplayImage(jpegLibRef, photoHandle, &displayParam);
if (error != errNone)
goto ErrorExit;
img2 = WinCreateBitmapWindow((BitmapPtr) b3, &error);
WinDeleteWindow(img, false);


PalmPhotoCloseImage(jpegLibRef, photoHandle);
PalmPhotoLibClose(jpegLibRef); SysLibRemove(jpegLibRef);


return img2;

ErrorExit:
if (photoHandle)
PalmPhotoCloseImage(jpegLibRef, photoHandle);
if (jpegLibRef) {
PalmPhotoLibClose(jpegLibRef); SysLibRemove(jpegLibRef);
}


   return NULL;
} // LoadJPG


Regis St-Gelais wrote:


"Chris Olson" <[EMAIL PROTECTED]> a �crit dans le message de
news:[EMAIL PROTECTED]


Umm, the SDK comes with an installable version of the PalmPhotoLib.prc ...




The readme.txt file in the PalmPhotoLib of the SDK says: QUOTE The Palm Photo API allows developers to take advantage of services in the Palm Photos application, v.1.1.0.20. The API will work only in conjunction with Photos v.1.1.0.20 which is available on the Tungsten|T3 and Tungsten|E devices. /QUOTE

Anyway, I want some thing that won't need an external prc. So I will stick
to jcpalm which can be included directly into my app.





--
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to