Skip navigation.
Home
The QNX Community Portal

View topic - About PgSetDrawMode().

About PgSetDrawMode().

Read-only archive of qnx.gui (Creating graphical applications within a GUI environment, such as Photon or PhAB) at inn.qnx.com

About PgSetDrawMode().

Postby dxwang » Tue Jan 30, 2007 12:51 pm

I want to choose a region for curve to magnify, when I press the left mouse button, then the start upright line is drawed. as I move the mouse, next upright line will be drawed. but I don't want to draw some many upright lines. I just want two upright lines, one is the start, the other is the current. In vc++,just use int nnormal=dc.SetROP2(R2_MERGEPENNOT); and dc.SetROP2(nnormal);
MERGEPENNOT :Pixel is a combination of the pen color and the inverse of the screen color (final pixel = (NOT screen pixel) OR pen).

In qnx6.3.0, I have tried below, but there are three upright lines, the first one is blue,it is right. the second and the third are yellow, not blue. I don't know why. I also have tried other modes, it isn't what I want.

PgSetStrokeColor(Pg_BLUE);
PgDrawILine(startpoint.x-35,p[0].y+100,startpoint.x-35,p[1].y+height_per+60 );
PgSetDrawMode(Pg_DRAWMODE_XOR);
PgDrawILine(tmppoint.x,p[0].y+100,tmppoint.x,p[1].y+height_per+60);
PgDrawILine(xmove+5,p[0].y+100,xmove+5,p[1].y+height_per+60);
tmppoint.x=xmove+5,tmppoint.y=ymove;
PgSetDrawMode(Pg_DRAWMODE_OPAQUE);

Thanks.
dxwang
Senior Member
 
Posts: 129
Joined: Mon Sep 27, 2004 1:39 pm

Re: About PgSetDrawMode().

Postby dxwang » Tue Jan 30, 2007 12:59 pm

dxwang wrote:I want to choose a region for curve to magnify, when I press the left mouse button, then the start upright line is drawed. as I move the mouse, next upright line will be drawed. but I don't want to draw some many upright lines. I just want two upright lines, one is the start, the other is the current. In vc++,just use int nnormal=dc.SetROP2(R2_MERGEPENNOT); and dc.SetROP2(nnormal);
MERGEPENNOT :Pixel is a combination of the pen color and the inverse of the screen color (final pixel = (NOT screen pixel) OR pen).

In qnx6.3.0, I have tried below, but there are three upright lines, the first one is blue,it is right. the second and the third are yellow, not blue. I don't know why. I also have tried other modes, it isn't what I want.

case Ph_EV_PTR_MOTION_BUTTON:
PgSetStrokeColor(Pg_BLUE);
PgDrawILine(startpoint.x-35,p[0].y+100,startpoint.x-35,p[1].y+height_per+60 );
PgSetDrawMode(Pg_DRAWMODE_XOR);
PgDrawILine(tmppoint.x,p[0].y+100,tmppoint.x,p[1].y+height_per+60);
PgDrawILine(xmove+5,p[0].y+100,xmove+5,p[1].y+height_per+60);
tmppoint.x=xmove+5,tmppoint.y=ymove;
PgSetDrawMode(Pg_DRAWMODE_OPAQUE);

Thanks.
dxwang
Senior Member
 
Posts: 129
Joined: Mon Sep 27, 2004 1:39 pm

Re: About PgSetDrawMode().

Postby dxwang » Tue Jan 30, 2007 1:01 pm

dxwang wrote:
dxwang wrote:I want to choose a region for curve to magnify, when I press the left mouse button, then the start upright line is drawed. as I move the mouse, next upright line will be drawed. but I don't want to draw some many upright lines. I just want two upright lines, one is the start, the other is the current. In vc++,just use int nnormal=dc.SetROP2(R2_MERGEPENNOT); and dc.SetROP2(nnormal);
MERGEPENNOT :Pixel is a combination of the pen color and the inverse of the screen color (final pixel = (NOT screen pixel) OR pen).

In qnx6.3.0, I have tried below, but there are three upright lines, the first one is blue,it is right. the second and the third are yellow, not blue. I don't know why. I also have tried other modes, it isn't what I want.

case Ph_EV_PTR_MOTION_BUTTON:
PgSetStrokeColor(Pg_BLUE);
PgDrawILine(startpoint.x-35,p[0].y+100,startpoint.x-35,p[1].y+height_per+60 );
PgSetDrawMode(Pg_DRAWMODE_OR);
PgDrawILine(tmppoint.x,p[0].y+100,tmppoint.x,p[1].y+height_per+60);
PgDrawILine(xmove+5,p[0].y+100,xmove+5,p[1].y+height_per+60);
tmppoint.x=xmove+5,tmppoint.y=ymove;
PgSetDrawMode(Pg_DRAWMODE_OPAQUE);

Thanks.
dxwang
Senior Member
 
Posts: 129
Joined: Mon Sep 27, 2004 1:39 pm

RE: Re: About PgSetDrawMode().

Postby dxwang » Wed Jan 31, 2007 3:36 am

have solved In QNX 6.3 OS Plate
dxwang
Senior Member
 
Posts: 129
Joined: Mon Sep 27, 2004 1:39 pm


Return to qnx.gui

Who is online

Users browsing this forum: No registered users and 1 guest