Haider Iqbal wrote:
> I want to show JPG images in my application. I have used jpeglib from the 
> following link: http://www.nyctergatis.com/jpeglib
> I have two issues:
> 
> 1. How to Convert .jpg to .pdb Format.
> 
> Please tell me that is there a utility to convert the JPG image into PDB 
> image.

What's a "PDB image"?  I don't think there is any such thing.

If your goal is to put a JPEG into a PDB, one way to do it would be
to use the File Streaming functions.  See the section called "File
Streaming" in the Palm OS API reference.  These functions allow you
to encapsulate *any* type of file into a PDB.  The "Files and Databases"
section of the Programmer's Companion gives a little background on
them.

I don't know of any code that can write a file into a PDB on the
desktop in a way that will make that PDB compatible with the File
Streaming API.  It may exist (and if it does, I'd like to know about
it!), or it may not.  However, you can convert files on the Palm
by calling the File Streaming functions and using them to copy a
file from the SD Card.  This is great if you only want to convert
a small number of files, but not so great if you want users to
be able to convert them.

I haven't used the jpeglib you're talking about (I ported the IJG
code myself before that was available), so I don't know exactly
how you can use it with a PDB.  I would assume it's possible to
read JEPG data directly from memory with that library, so one
approach is to copy all the data out of the PDB into the heap and
then decode the JPEG from there.  That would waste lots of memory
(temporarily), but it should work.

Also, if you do not wish to use the File Streaming functions, you
could just define your own PDB format easily enough.  Just define
it so that record 0 of the PDB contains the first 32 kilobytes
of the JPEG file, record 1 contains the next 32 kilobytes, etc.
Then concatenate all the records before you decode the JPEG.
The point is just to choose some way to use the PDB's records
to represent the sequence of bytes that makes up the JPEG.

  - Logan

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

Reply via email to