On Fri, 19 Aug 2005 15:32:09 -0400, Shashank wrote:
I would really appreciate it if someone could help me with this.
Hhm, I probably did the same like you, but I didn’t have any problems.
Can you post pieces of your source code, specially the
‘drawing’-function of your Raw-Widget?
I also used a PtRaw-Widget, with a call of PgDrawPhImagemx () in the draw
function (works with QNX6.2 and QNX6.3). AFAIR it was mandantory, the
the image has to be in the shared memory, but I’m not sure.
Here’s a piece of my source (the mutex-stuff is, because the grabber is
is handled in another thread):
//------------------------------------------------- draw_function()
void draw_function ( PtWidget_t * widget,
PhTile_t * damage )
{
if ( measure )
StopWatchStart ( );
pthread_mutex_lock ( &image_mutex );
// Do our drawing…
PgDrawPhImagemx ( &image_pos, image, 0 );
pthread_mutex_unlock ( &image_mutex );
if ( measure )
StopWatchStop ( “PgDrawImagemx” );
}
//------------------------------------------ image_widget_create()
void image_widget_create ( PtWidget_t * parent )
{
PhPoint_t origin = { 0, 0 };
PtArg_t wargs[20];
int wargc = 0;
pthread_mutex_lock ( &image_mutex );
if ( image_widget )
PtDestroyWidget ( image_widget );
/*
** Create a ‘Raw’-Widget for drawing purposes.
*/
wargc = 0;
PtSetArg ( &wargs[wargc++], Pt_ARG_POS, &origin, 0 );
PtSetArg ( &wargs[wargc++], Pt_ARG_DIM, &image->size, 0 );
PtSetArg ( &wargs[wargc++], Pt_ARG_RAW_DRAW_F, &draw_function, 0 );
PtSetArg ( &wargs[wargc++], Pt_ARG_BORDER_WIDTH, 0, 0 );
PtSetArg ( &wargs[wargc++], Pt_ARG_FLAGS, Pt_FALSE, Pt_TRUE );
image_widget = PtCreateWidget ( PtRaw, parent, wargc, wargs );
if ( image_widget )
PtRealizeWidget ( image_widget );
pthread_mutex_unlock ( &image_mutex );
}
HTH,
Karsten.
\
Karsten P. Hoffmann <karsten.p.hoffmann@web.de>
“I love deadlines. I especially like the whooshing sound
they make as they go flying by.”
[In memoriam Douglas Adams, 1952-2001]