keyongtech


  keyongtech > vb.* > vb.general.discussion > 08/2009

 #1  
08-18-09, 03:14 AM
Stan Hilliard
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
 #2  
08-18-09, 11:45 AM
Mike Williams
"Stan Hilliard" <usenetreplyMS> wrote in message
news:ghm4

> 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?


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
 #3  
08-18-09, 01:53 PM
MikeD
"Stan Hilliard" <usenetreplyMS> wrote in message
news:ghm4
>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?
>



And the VB part of that is?
 #4  
08-18-09, 03:31 PM
Nobody
"MikeD" <nobody> wrote in message
news:6068
> 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/micro...be419e76c58cac
 #5  
08-18-09, 04:11 PM
Jeff Johnson
"Nobody" <nobody> wrote in message
news:4004

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


I missed it too.
 #6  
08-19-09, 05:28 PM
Lorin
Thanks from me too! Nice explanation.
Similar Threads
Paint Shop Pro X1

When I starts the program it is running real slow and after a while it is shuting down and I have to restart it. I have changed so I am running it as adminstrator. Have...

Paint shop Pro

Hello I am a new Paint Shop Pro user and I recently bought this computer with vista I am having some problems with PSP shutting down I have versions 8 and 9 thanks in advance...

IE7 & Paint Shop Pro

I just started working with the program again since adding IE7 and find occasionally, I'm unable to complete a task such as Select All>Selections Modify>Select Selection...

Paint Shop Pro X

Just ordered from Amazon - $99 with a $30 rebate - for a total of $69. That's actually cheaper than ver 9 was on Amazon with the rebate. I never have been that happy with...

paint shop

I just received a camera and do not have a photo editing program other than what came with the printer. Any recommendations as to which/what software to buy? I am using XP...


All times are GMT. The time now is 01:16 PM. | Privacy Policy