DrvStrokePath

Hi I’m developing mirror display driver.
And I got problem. I want to get area (as single rectangle) on which DrvStrokePath draws path(es).
How can I do this?
I tried to get from pco->rclBounds but I suspect that I get not all of them.

xxxxx@gmail.com wrote:

Hi I’m developing mirror display driver.
And I got problem. I want to get area (as single rectangle) on which DrvStrokePath draws path(es).
How can I do this?
I tried to get from pco->rclBounds but I suspect that I get not all of them.

Sir, you really need to learn how to research these questions on your
own. It took me all of 45 seconds to find PATHOBJ_vGetBounds.

Note that you are probably interested in the intersection of the path
bounds and the clip region bounds.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Sorry for silly question.
I tried to do this code

RECTFX rectfx;
RECTL r;
PATHOBJ_vGetBounds(ppo, &rectfx);
r.left = rectfx.xLeft;
r.top = rectfx.yTop;
r.right = rectfx.xRight;

but I get rectangle which coordinates left and top are bigger then screen resolution.
Could you tell me please, how I can fix this?

Or with PATHOBJ_vGetBounds I can only get right and bottom coordinates?

xxxxx@gmail.com wrote:

Sorry for silly question.
I tried to do this code

RECTFX rectfx;
RECTL r;
PATHOBJ_vGetBounds(ppo, &rectfx);
r.left = rectfx.xLeft;
r.top = rectfx.yTop;
r.right = rectfx.xRight;

but I get rectangle which coordinates left and top are bigger then screen resolution.
Could you tell me please, how I can fix this?

You can look up the definition of a RECTFX in the documentation. It
does NOT contain simple integers.

Actually, after looking it up, I’ve decided that’s not fair, because it
doesn’t seem to be clearly defined. A RECTFX contains fixed point
numbers in 28.4 format, so that the coordinates can use fractional
pixels. 28.4 means there are 28 bits to the left of the decimal/binary
point, and 4 bits to the right. So, 0.5 pixel is stored as 00000008, 1
pixel is 00000010. To convert a RECTFX to a RECT, do this:

r.left = (rectfx.xLeft + 8) >> 4;
r.top = (rectfx.yTop + 8) >> 4;
r.right = (rectfx.xRight + 8) >> 4;
r.bottom = (rectfx.yBottom + 8) >> 4;


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Now it’s works.
Thank so much for help.

The following is probably more correct and it uses a macro in winddi.h intended for this purpose:

r.left = FXTOLFLOOR(rectfx.xLeft);
r.right = FXTOLCEILING(rectfx.xRight);
r.top = FXTOLFLOOR(rectfx.yTop);
r.bottom = FXTOLCEILING(rectfx.yBottom);