Thanks a ton Logan. Ive managed to sync a few bmps into the VFS and am able to see the files exist there also(using FileZ). But my concern is that how do we get the whole image to be displayed on the screen.
Ive read ur suggestion on using the VFSFileRead operation. But how do you think this can be rendered on the screen finally. Rgds DMA. ----- Original Message ----- From: "Logan Shaw" <[EMAIL PROTECTED]> To: "Palm Developer Forum" <[email protected]> Sent: Thursday, September 22, 2005 2:34 PM Subject: Re: Need to access resources from VFS. > Deepak.MA wrote: > > I have a situation wherein i need to place my resources(bitmaps) in > > various folders/dirs in VFS. Am using a custom hardware, where the VFS > > has been internally configured for the Flash. In the above context, i > > understand that the bitmaps can be accessed by enumerating through teh > > volumes first, then through the relevant directory and obtain the file > > names that reside there. > > A bitmap is just a sequence of bytes. It can be accessed in any way > that you want to which lets you get the correct bytes. > > In a typical application, bitmaps are stored as records in a resource > database. You use DmGetResource() to get a handle to the desired > resource, then lock it, and then you have a pointer to the bitmap. > > If you have a resource database stored as a PRC file on a VFS filesystem, > you can use VFSFileDBGetResource() to read that resource out of the > PRC file and into a MemHandle in RAM, which you can then lock, giving > you a pointer to the bitmap. > > If you have each bitmap in its own file, then you will have to do > something a bit different, like opening the file, using VFSFileSize() > to get its size, allocating some RAM, and then copying the bitmap > into RAM by doing VFSFileRead() in a loop. (If you use RAM in the > storage heap, you will want to use VFSFileReadData() instead of > VFSFileRead().) From there, once again, you have a pointer, and > you can do with it what you wish. > > > Additionally, i am curious to know as to how i > > can get the bitmaps into that location of the Flash. > > That depends on how you want to write them. If you would like to write > them as separate files, then just create the file and copy data into it > with VFSFileWrite(). If you'd like to modify a PRC file that exists > on the VFS filesystem and update one of its records, that is quite a > bit harder, especially if the PRC file is large. I recommend avoiding > that approach unless you have a good reason to do it. > > - Logan > > -- > For information on using the PalmSource Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/ > "SASKEN RATED THE BEST COMPANY TO WORK FOR IN INDIA - SURVEY 2004 conducted by the BUSINESS TODAY -Mercer-TNS India" SASKEN BUSINESS DISCLAIMER This message may contain confidential, proprietary or legally Privileged information. In case you are not the original intended Recipient of the message, you must not, directly or indirectly, use, Disclose, distribute, print, or copy any part of this message and you are requested to delete it and inform the sender. Any views expressed in this message are those of the individual sender unless otherwise stated. Nothing contained in this message shall be construed as an offer or acceptance of any offer by Sasken Communication Technologies Limited ("Sasken") unless sent with that express intent and with due authority of Sasken. Sasken has taken enough precautions to prevent the spread of viruses. However the company accepts no liability for any damage caused by any virus transmitted by this email -- For information on using the PalmSource Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
