Hi all,
Check out this code segment. While compiling i get an error
that "error: too many arguments to function `GcGetCurrentContext'".ie;
at GcGetCurrentContext(gc) method call. How can i pass the GcHandle to
GcGetCurrentContext().
What could be the issue behind this.. Please help.
bmpP = BmpCreate(10, 10, 8, NULL, &error);
if (bmpP) {
gc = GcCreateBitmapContext(bmpP);
if (gc) {
GcSetColor(gc, 0, 0, 0, 255);
GcRoundRect(gc, 0, 0, 50, 15, 3, 3);
GcPaint(gc);
/* etc */
GcReleaseContext(gc);
}
}
gcBitmap = FrmGetBitmapHandle(formP, gAppDB, bitmapRsc,
1100, 0);
//if (!gcBitmap)
//return memErrNotEnoughSpace;
GcGetCurrentContext(gc);
if (gc) {
GcDrawBitmapAt(gc, gcBitmap, NULL, 30, 50);
GcReleaseContext(gc);
}
Anoop wrote:
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/
|