About PgSetDrawMode().

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 :stuck_out_tongue:ixel 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.

I’m not sure exactly what you are asking here, if the first line is correct, and the next two are wrong, there is only one thing happening which is different, this line:

PgSetDrawMode(Pg_DRAWMODE_XOR);

Take out that line and all lines will be in blue. Maybe I misunderstand the problem here though.

Yes, I know what you said, if take out that line, the so many upright blue lines. I just want two lines. so I use this to control draw mode.

case Ph_EV_PTR_MOTION_BUTTON:
PgSetStrokeColor(Pg_BLUE); set blue stroke
PgDrawILine(startpoint.x-35,p[0].y+100,startpoint.x-35,p[1].y+height_per+60 ) ; – draw blue line
PgSetDrawMode(Pg_DRAWMODE_XOR); set XOR mode
PgDrawILine(tmppoint.x,p[0].y+100,tmppoint.x,p[1].y+height_per+60) ; – draw line of color = Pg_BLUE xor color of surface = yellow!!!
PgDrawILine(xmove+5,p[0].y+100,xmove+5,p[1].y+height_per+60) ; – the same
tmppoint.x=xmove+5,tmppoint.y=ymove;
PgSetDrawMode(Pg_DRAWMODE_OPAQUE);

Try PgSetStrokeColor(Pg_YELLOW). If i don’t mistake in this case line will be BLUE.

where to use PgSetStrokeColor(Pg_YELLOW). Thanks

try before PgSetDrawMode(Pg_DRAWMODE_XOR);

Yes, you are right , But there are three lines , can’t the middle one be cutted. Thanks. and can you explain it for me why to set it to Pg_yellow.

1 To delete this line draw line
over it of COLOR = COLOR_YOU_LINE xor COLOR_YOU_SURFACE
2 Because Pg_YELLOW = Pg_BLUE xor Pg_BLACK(i think that color of you surface when you draw is BLACK).

Yes, I have solved this problem, Thanks very much, qnxloader. how excellent! haha.
But I still have a mouse Coordinate between ptraw Draw Function and Raw Event Function . I will post a new topoic . Thanks for your attention!