2 pixel offset

hi there,

when i draw the following, i get a 2 pixel offset between the left/top of
the window and the label. which resource am i missing?

thanks for you help.


if( PtInit( NULL ) == -1 ) PtExit( EXIT_FAILURE );

PhImage_t* image;
image = PxLoadImage( “./test/images/image.jpg”, NULL );

PtArg_t args[10]; int n = 0;
PtSetArg( &args[n++], Pt_ARG_HEIGHT, 200, 0 );
PtSetArg( &args[n++], Pt_ARG_WIDTH, 200, 0 );
PtSetArg( &args[n++], Pt_ARG_MARGIN_HEIGHT, 0, 0 );
PtSetArg( &args[n++], Pt_ARG_MARGIN_WIDTH, 0, 0 );
PtSetArg( &args[n++], Pt_ARG_WINDOW_RENDER_FLAGS, 0, Ph_WM_RENDER_TITLE
|



Ph_WM_RENDER_BORDER );
PtWidget_t* window = PtCreateWidget( PtWindow, Pt_NO_PARENT, n, args );
PtRealizeWidget( window );

n = 0;
PtSetArg( &args[n++], Pt_ARG_LABEL_TYPE, Pt_IMAGE, 0 );
PtSetArg( &args[n++], Pt_ARG_BEVEL_WIDTH, 0, 0 );
PtSetArg( &args[n++], Pt_ARG_TEXT_IMAGE_SPACING, 0, 0 );
PtSetArg( &args[n++], Pt_ARG_LABEL_IMAGE, image, 0 );
PtWidget_t* label = PtCreateWidget( PtLabel, window, n, args );
PtRealizeWidget( label );

PtMainLoop();

PtLabel:
Set the margins to 0 (Pt_ARG_MARGIN_{ LEFT|RIGHT|TOP|BOTTOM })
and
Pt_ARG_BASIC_FLAGS, Pt_FALSE,
Pt_ALL_ETCHES|Pt_ALL_INLINES|Pt_ALL_OUTLINES|Pt_ALL_BEVELS.

-Misha.
“Joerg Scherer” <joerg.schererNOSPAM@am3.com> wrote in message
news:adielm$si3$1@inn.qnx.com

hi there,

when i draw the following, i get a 2 pixel offset between the left/top of
the window and the label. which resource am i missing?

thanks for you help.


if( PtInit( NULL ) == -1 ) PtExit( EXIT_FAILURE );

PhImage_t* image;
image = PxLoadImage( “./test/images/image.jpg”, NULL );

PtArg_t args[10]; int n = 0;
PtSetArg( &args[n++], Pt_ARG_HEIGHT, 200, 0 );
PtSetArg( &args[n++], Pt_ARG_WIDTH, 200, 0 );
PtSetArg( &args[n++], Pt_ARG_MARGIN_HEIGHT, 0, 0 );
PtSetArg( &args[n++], Pt_ARG_MARGIN_WIDTH, 0, 0 );
PtSetArg( &args[n++], Pt_ARG_WINDOW_RENDER_FLAGS, 0,
Ph_WM_RENDER_TITLE
|




Ph_WM_RENDER_BORDER );
PtWidget_t* window = PtCreateWidget( PtWindow, Pt_NO_PARENT, n,
args );
PtRealizeWidget( window );

n = 0;
PtSetArg( &args[n++], Pt_ARG_LABEL_TYPE, Pt_IMAGE, 0 );
PtSetArg( &args[n++], Pt_ARG_BEVEL_WIDTH, 0, 0 );
PtSetArg( &args[n++], Pt_ARG_TEXT_IMAGE_SPACING, 0, 0 );
PtSetArg( &args[n++], Pt_ARG_LABEL_IMAGE, image, 0 );
PtWidget_t* label = PtCreateWidget( PtLabel, window, n, args );
PtRealizeWidget( label );

PtMainLoop();

thanks for your help, i tried it, but the problem persists :frowning:

maybe for your interest:
Pt_ALL = Pt_ALL_ETCHES|Pt_ALL_INLINES|Pt_ALL_OUTLINES|Pt_ALL_BEVELS



“Misha Nefedov” <mnefedov@qnx.com> schrieb im Newsbeitrag
news:adiq6k$7u2$1@inn.qnx.com

PtLabel:
Set the margins to 0 (Pt_ARG_MARGIN_{ LEFT|RIGHT|TOP|BOTTOM })
and
Pt_ARG_BASIC_FLAGS, Pt_FALSE,
Pt_ALL_ETCHES|Pt_ALL_INLINES|Pt_ALL_OUTLINES|Pt_ALL_BEVELS.

-Misha.
“Joerg Scherer” <> joerg.schererNOSPAM@am3.com> > wrote in message
news:adielm$si3$> 1@inn.qnx.com> …
hi there,

when i draw the following, i get a 2 pixel offset between the left/top
of
the window and the label. which resource am i missing?

thanks for you help.


if( PtInit( NULL ) == -1 ) PtExit( EXIT_FAILURE );

PhImage_t* image;
image = PxLoadImage( “./test/images/image.jpg”, NULL );

PtArg_t args[10]; int n = 0;
PtSetArg( &args[n++], Pt_ARG_HEIGHT, 200, 0 );
PtSetArg( &args[n++], Pt_ARG_WIDTH, 200, 0 );
PtSetArg( &args[n++], Pt_ARG_MARGIN_HEIGHT, 0, 0 );
PtSetArg( &args[n++], Pt_ARG_MARGIN_WIDTH, 0, 0 );
PtSetArg( &args[n++], Pt_ARG_WINDOW_RENDER_FLAGS, 0,
Ph_WM_RENDER_TITLE
|





Ph_WM_RENDER_BORDER );
PtWidget_t* window = PtCreateWidget( PtWindow, Pt_NO_PARENT, n,
args );
PtRealizeWidget( window );

n = 0;
PtSetArg( &args[n++], Pt_ARG_LABEL_TYPE, Pt_IMAGE, 0 );
PtSetArg( &args[n++], Pt_ARG_BEVEL_WIDTH, 0, 0 );
PtSetArg( &args[n++], Pt_ARG_TEXT_IMAGE_SPACING, 0, 0 );
PtSetArg( &args[n++], Pt_ARG_LABEL_IMAGE, image, 0 );
PtWidget_t* label = PtCreateWidget( PtLabel, window, n, args );
PtRealizeWidget( label );

PtMainLoop();
\

thanx again for your help misha, your code finally helped me.
i simply didnt’t set Pt_ARG_MARGIN_WIDTH/HEIGHT to 0


“Misha Nefedov” <mnefedov@qnx.com> schrieb im Newsbeitrag
news:adiq6k$7u2$1@inn.qnx.com

PtLabel:
Set the margins to 0 (Pt_ARG_MARGIN_{ LEFT|RIGHT|TOP|BOTTOM })
and
Pt_ARG_BASIC_FLAGS, Pt_FALSE,
Pt_ALL_ETCHES|Pt_ALL_INLINES|Pt_ALL_OUTLINES|Pt_ALL_BEVELS.

-Misha.
“Joerg Scherer” <> joerg.schererNOSPAM@am3.com> > wrote in message
news:adielm$si3$> 1@inn.qnx.com> …
hi there,

when i draw the following, i get a 2 pixel offset between the left/top
of
the window and the label. which resource am i missing?

thanks for you help.


if( PtInit( NULL ) == -1 ) PtExit( EXIT_FAILURE );

PhImage_t* image;
image = PxLoadImage( “./test/images/image.jpg”, NULL );

PtArg_t args[10]; int n = 0;
PtSetArg( &args[n++], Pt_ARG_HEIGHT, 200, 0 );
PtSetArg( &args[n++], Pt_ARG_WIDTH, 200, 0 );
PtSetArg( &args[n++], Pt_ARG_MARGIN_HEIGHT, 0, 0 );
PtSetArg( &args[n++], Pt_ARG_MARGIN_WIDTH, 0, 0 );
PtSetArg( &args[n++], Pt_ARG_WINDOW_RENDER_FLAGS, 0,
Ph_WM_RENDER_TITLE
|





Ph_WM_RENDER_BORDER );
PtWidget_t* window = PtCreateWidget( PtWindow, Pt_NO_PARENT, n,
args );
PtRealizeWidget( window );

n = 0;
PtSetArg( &args[n++], Pt_ARG_LABEL_TYPE, Pt_IMAGE, 0 );
PtSetArg( &args[n++], Pt_ARG_BEVEL_WIDTH, 0, 0 );
PtSetArg( &args[n++], Pt_ARG_TEXT_IMAGE_SPACING, 0, 0 );
PtSetArg( &args[n++], Pt_ARG_LABEL_IMAGE, image, 0 );
PtWidget_t* label = PtCreateWidget( PtLabel, window, n, args );
PtRealizeWidget( label );

PtMainLoop();
\