Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Printed size of screen captures from MS Paint and from Paint Shop Pro.

5 views
Skip to first unread message

Stan Hilliard

unread,
Aug 17, 2009, 11:11:36 PM8/17/09
to
I am trying to understand the printing of screen captures of forms.

I put a button on my form and use printform. The printed image is 6
inches wide. It is also 6 inches wide if I capture and paste it into
Open Office.

But when I capture the paste the image into MS Paint or Paint Shop
Pro, the printed image is 8 inches wide instead of 6.

How can I make screen capture print the smaller size from Paint and
from Paint Shop Pro?

Stan Hilliard

Mike Williams

unread,
Aug 18, 2009, 6:45:06 AM8/18/09
to
"Stan Hilliard" <usenet...@samplingplansNOTSPAM.com> wrote in message
news:cn3k85t2gjt125lc0...@4ax.com...

To simplify my explanation I'll stick to explaining what happens on most
typical Windows machines which run at the standard 96 pixels per logical
inch setting (commonly called the "small fonts" setting). There are some
machines which run at other logical scales (120 pixels per inch is typical,
although there lots of other possible values), but much the same reasoning
applies to those machines as well, although the details are slightly
different.

If for example you create a standard default VB Form and drag out its width
in the IDE until its ScaleWidth (client area width) is 8640 twips then that
Form will have a client area width of 6 logical inches (because there are
always 1440 twips in an inch). Presumably your own Form is something like
that. On a standard 96 dpi machine that 6 inches will equate to 576 pixels
(6 x 96). If you then use the VB PrintForm method to print the client area
of the Form to a printer you will see that the output is exactly 6 inches
wide. That's because the VB PrintForm method prints the Form at is exact
logical size.

However, if you perform some action that saves or copies that image as a
bitmap then the default logical size of the bitmap (as seen by an
application printing it) depends on whether or not that bitmap contains
information relating to its intended physical size. That information is held
in the BITMAPINFOHEADER biXPelsPerMeter and biYPelsPerMeter entries (two
Longs). If the bitmap actually does contain valid entries in these two Longs
then many (although not necessarily all) applications will print the bitmap
at the desired logical size in accordance with those values. For example, if
the bitmap contains the equivalent of 96 pixels per inch in those two
entries then most applications will (by default) print the bitmap at that
desired scale, so that in such a case MS Paint (current versions of which DO
properly use that information) would also print the above 576 pixel wide
bitmap at 6 inches wide . . .

. . . but if the bitmap does /not/ contain valid entries in those two Longs
(if they are both zero) then most applications will print the bitmap at
their own default scale. In the case of MS Paint the default scale is 72
pixels per logical inch. So, if both entries I have mentioned are zero then
MS Paint would have no information regarding the actual intended physical
size of the bitmap and it would therefore print the bitmap at 72 pixels per
logical inch, resulting in MS Paint printing the above 576 pixel wide bitmap
at a width of 8 inches. PaintShop Pro would appear to have the same default
scale setting as MS Paint, whereas Open Office would appear to default to 96
dpi, or perhaps to the logical dpi of the machine on which it is running.

> How can I make screen capture print the smaller
> size from Paint and from Paint Shop Pro?

It depends on the details of what you are doing. If you save the bitmap of
your Form's client area as a standard .bmp file then you can make your code
ensure that the correct desired scale values are inserted into
biXPelsPerMeter and biYPelsPerMeter positions of the .bmp file. This will
cause MS Paint to print the bitmap at your desired logical size. Otherwise,
if you want to simply copy the image to the clipboard and then paste it into
MS Paint you will need to find another way around it, perhaps a way of
fiddling with the data on the clipboard.

Mike

MikeD

unread,
Aug 18, 2009, 8:53:19 AM8/18/09
to

"Stan Hilliard" <usenet...@samplingplansNOTSPAM.com> wrote in message
news:cn3k85t2gjt125lc0...@4ax.com...


And the VB part of that is?

--
Mike

Nobody

unread,
Aug 18, 2009, 10:31:23 AM8/18/09
to
"MikeD" <nob...@nowhere.edu> wrote in message
news:uMkmhLAI...@TK2MSFTNGP03.phx.gbl...

> And the VB part of that is?

The word "printform", in proper case PrintForm. You probably didn't see the
reply by Mike Williams in your news server. Here is the online version just
in case:

http://groups.google.com/group/microsoft.public.vb.general.discussion/msg/19be419e76c58cac


Jeff Johnson

unread,
Aug 18, 2009, 11:11:51 AM8/18/09
to
"Nobody" <nob...@nobody.com> wrote in message
news:O$c4WCBIK...@TK2MSFTNGP05.phx.gbl...

> The word "printform", in proper case PrintForm.

I missed it too.


Lorin

unread,
Aug 19, 2009, 12:28:24 PM8/19/09
to
Thanks from me too! Nice explanation.



0 new messages