1. "Printing/grabbing window contents"

Recently some people were commenting on this subject.
I got how to save your "Print Preview" window to a bitmap with win32dib.

But how can I print the bitmap to my printer from within my Euphoria
Program without exiting
and going onto the Bmp program?

new topic     » topic index » view message » categorize

2. Re: "Printing/grabbing window contents"

don cole wrote:
> 
> 
> Recently some people were commenting on this subject.
> I got how to save your "Print Preview" window to a bitmap with win32dib.
> 
> But how can I print the bitmap to my printer from within my Euphoria
> Program without exiting
> and going onto the Bmp program?

Because the screen and printer have different sized pixels, you will
need to resize your bitmap for printing.

First, calculate the screen bitmap's physical width and height. Use the
GetDeviceCaps API with the LOGPIXELSX and LOGPIXELSY parameters.
Then calculate the number of horizontal and vertical printer pixels
this would need for the same physical size.
Finally, use the StretchBlit routine to copy and resize the screen
bitmap to the printer.

-- 
Derek Parnell
Melbourne, Australia

new topic     » goto parent     » topic index » view message » categorize

3. Re: "Printing/grabbing window contents"

Derek Parnell wrote:
> 
> 
> don cole wrote:
> > 
> > 
> > Recently some people were commenting on this subject.
> > I got how to save your "Print Preview" window to a bitmap with win32dib.
> > 
> > But how can I print the bitmap to my printer from within my Euphoria
> > Program without exiting
> > and going onto the Bmp program?
> 
> Because the screen and printer have different sized pixels, you will
> need to resize your bitmap for printing.
> 
> First, calculate the screen bitmap's physical width and height. Use the
> GetDeviceCaps API with the LOGPIXELSX and LOGPIXELSY parameters.
> Then calculate the number of horizontal and vertical printer pixels
> this would need for the same physical size.
> Finally, use the StretchBlit routine to copy and resize the screen
> bitmap to the printer.
> 
> -- 
> Derek Parnell
> Melbourne, Australia
> 
Thank you for your reply.
I will study that but for now what I want know is how to get the BMP
to the Printer in any size.
Do I use something like
         setPenPosition( Printer, 0, y )
        wPuts( Printer, "myPix.bmp" )
?

new topic     » goto parent     » topic index » view message » categorize

4. Re: "Printing/grabbing window contents"

don cole wrote:
> 
> 
> Derek Parnell wrote:
> > 
> > 
> > don cole wrote:
> > > 
> > > 
> > > Recently some people were commenting on this subject.
> > > I got how to save your "Print Preview" window to a bitmap with win32dib.
> > > 
> > > But how can I print the bitmap to my printer from within my Euphoria
> > > Program without exiting
> > > and going onto the Bmp program?
> > 
> > Because the screen and printer have different sized pixels, you will
> > need to resize your bitmap for printing.
> > 
> > First, calculate the screen bitmap's physical width and height. Use the
> > GetDeviceCaps API with the LOGPIXELSX and LOGPIXELSY parameters.
> > Then calculate the number of horizontal and vertical printer pixels
> > this would need for the same physical size.
> > Finally, use the StretchBlit routine to copy and resize the screen
> > bitmap to the printer.
> > 
> > -- 
> > Derek Parnell
> > Melbourne, Australia
> > 
> Thank you for your reply.
> I will study that but for now what I want know is how to get the BMP
> to the Printer in any size.
> Do I use something like
>          setPenPosition( Printer, 0, y )
>         wPuts( Printer, "myPix.bmp" )
> ?

  atom bmp
  bmp = loadBitmapFromFile("myPix.bmp")
  copyBlt(Printer, x, y, bmp)
  delete(bmp)


-- 
Derek Parnell
Melbourne, Australia

new topic     » goto parent     » topic index » view message » categorize

5. Re: "Printing/grabbing window contents"

----- Original Message -----
From: "Derek Parnell" <guest at RapidEuphoria.com>
To: <EUforum at topica.com>
Sent: Friday, June 11, 2004 2:30 AM
Subject: Re: "Printing/grabbing window contents"


>
>
> posted by: Derek Parnell <ddparnell at bigpond.com>
>
> don cole wrote:
> >
> >
> > Derek Parnell wrote:
> > >
> > >
> > > don cole wrote:
> > > >
> > > >
> > > > Recently some people were commenting on this subject.
> > > > I got how to save your "Print Preview" window to a bitmap with
win32dib.
> > > >
> > > > But how can I print the bitmap to my printer from within my Euphoria
> > > > Program without exiting
> > > > and going onto the Bmp program?
> > >
> > > Because the screen and printer have different sized pixels, you will
> > > need to resize your bitmap for printing.
> > >
> > > First, calculate the screen bitmap's physical width and height. Use
the
> > > GetDeviceCaps API with the LOGPIXELSX and LOGPIXELSY parameters.
> > > Then calculate the number of horizontal and vertical printer pixels
> > > this would need for the same physical size.
> > > Finally, use the StretchBlit routine to copy and resize the screen
> > > bitmap to the printer.
> > >
> > > --
> > > Derek Parnell
> > > Melbourne, Australia
> > >
> > Thank you for your reply.
> > I will study that but for now what I want know is how to get the BMP
> > to the Printer in any size.
> > Do I use something like
> >          setPenPosition( Printer, 0, y )
> >         wPuts( Printer, "myPix.bmp" )
> > ?
>
>   atom bmp
>   bmp = loadBitmapFromFile("myPix.bmp")
>   copyBlt(Printer, x, y, bmp)
>   delete(bmp)
>
>
> --
> Derek Parnell
> Melbourne, Australia
>

Why does that look too easy?
oh well, I guess I like a hard life.

    unkmar

PS: Just running my ratchet jaw cause it ain't wired shut.

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu