Code to capture client-area only also captures part of form-border



Hi

I am using GDI code to capture the client-area of a form,
paint it into a Picture object and finally print it out

The code is basically from MSDN with little modifications:
'How To Capture and Print the Screen, a Form, or Any Window'
'http://support.microsoft.com/?kbid=161299

and basically works very well.

However, when I am printing the picture captured fro the cleint-area and a borders to the printers-picture - I use 'PrintPictureToFitPage, which is a function of the same module published in the KB; I simply added two params for borders, that change the call og PaintPicture from

Prn.PaintPicture Pic, 0, 0, PrnPicWidth, PrnPicHeight

to
Prn.PaintPicture Pic, borderX, borderY, _
PrnPicWidth - (2 * borderX), PrnPicHeight - (2 * borderY)


- I realize that the client-area isn't captured absolutely precisely;
it includes a small edge of the form's lower border dispalyed as a
blue line (as for the default XP-theme for forms).

Is there a way to suppress this partial border-capturing?
Does it have to do with XP-styles that the pic captured isn't
precisely the client-area?
Does it have to do with screen-res-settings or other
device dependencies?

The code as mentioned is c&p'ed from:
http://support.microsoft.com/?kbid=161299

The functions i call are:
CaptureClient->CaptureWindow->CreateBitmapPicture
PrintPictureToFitPage

I only modified 'PrintPictureToFitPage' as described (two params for borders)

Any help very much appreciated,
Alex


.


Loading