Here is the code given in a thread may be it help to u
try it
After that we tried displaying image using the following code. The image
displayed in device is distorted and not clear .Please go through this
code segment and guide us.
void createbitmap()
{
Err error;
char *pData;
// UInt8 *pBitmapBits;
BitmapType *bmpP;
BitmapTypeV3 *bmpV3P;
ColorTableType *_ctbl;
// //MemHandle hBitmap;
_ctbl = (ColorTableType *)MemPtrNew(sizeof (ColorTableType) + (256 *
sizeof(RGBColorType)));
_ctbl->numEntries = 256;
bmpP = BmpCreate(95, 90, 8, NULL, &error);
pData = bmpRead(); // reads bitmap data
bmpV3P = BmpCreateBitmapV3(bmpP,kDensityDouble,pData,NULL);
WinDrawBitmap((BitmapType*)bmpV3P,50,50);
}
char* bmpRead()
{
FileRef fref , nfref;
Err err,err1;
MemHandle bufH;
char *bufBaseP;
UInt32 rb;
//FileRef fileRef = 0;
char path[] = "/Palm/programs/test.bmp" ;
UInt16 volRefNum;
UInt32 volIterator = vfsIteratorStart;
while (volIterator != vfsIteratorStop) {
err1 = VFSVolumeEnumerate(&volRefNum, &volIterator);
}
err = VFSFileOpen (volRefNum, path, vfsModeRead, &fref);
bufH = MemHandleNew (9716);
bufBaseP = MemHandleLock (bufH);
err = VFSFileRead (fref, 9716, bufBaseP, &rb);
VFSFileClose (fref);
MemHandleUnlock (bufH);
MemHandleFree (bufH);
return(bufBaseP);
}
--
For information on using the PalmSource Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/