1. Printing/grabbing window contents

Dear Euphorians

I would like to layout a window with some
text and perhaps some accompanying images,
and then be able to print the window as if
it were a print preview page. What is the
best way to achieve this with Eu/win3lib?

I don't want my users to have to do any
ctrl-alt-whatever to manually copy the
window (or the screen) to the clipboard.

Is there a way to render the contents of
a window (without its borders, titlebar etc.)
as postscript or as a bitmap image ready for
printing?

Best

Gordon
gwalias-bb at yahoo.com

new topic     » topic index » view message » categorize

2. Re: Printing/grabbing window contents

bitBlt() (I think) can do this; copy the window to a DIB
(maby created by Win32Dib, therefore allowing you to edit it first),
which you can then print.


Gordon Webster wrote:
> 
> 
> Dear Euphorians
> 
> I would like to layout a window with some
> text and perhaps some accompanying images,
> and then be able to print the window as if
> it were a print preview page. What is the
> best way to achieve this with Eu/win3lib?
> 
> I don't want my users to have to do any
> ctrl-alt-whatever to manually copy the
> window (or the screen) to the clipboard.
> 
> Is there a way to render the contents of
> a window (without its borders, titlebar etc.)
> as postscript or as a bitmap image ready for
> printing?
> 
> Best
> 
> Gordon
> gwalias-bb at yahoo.com
>

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

3. Re: Printing/grabbing window contents

I found copyToDib() in Win32Dibi; this just calls bitBlt(),
but is a bit easier to use.

>From Win32Dib docs:
copyToDib(dib, control, x, y, x1, y1, x2, y2)
-- draws the rectangular region (x1, y1) -> (x2, y2) from the control on the dib
at
-- position (x, y)


CoJaBo wrote:
> 
> 
> bitBlt() (I think) can do this; copy the window to a DIB
> (maby created by Win32Dib, therefore allowing you to edit it first),
> which you can then print.
> 
> 
> Gordon Webster wrote:
> > 
> > 
> > Dear Euphorians
> > 
> > I would like to layout a window with some
> > text and perhaps some accompanying images,
> > and then be able to print the window as if
> > it were a print preview page. What is the
> > best way to achieve this with Eu/win3lib?
> > 
> > I don't want my users to have to do any
> > ctrl-alt-whatever to manually copy the
> > window (or the screen) to the clipboard.
> > 
> > Is there a way to render the contents of
> > a window (without its borders, titlebar etc.)
> > as postscript or as a bitmap image ready for
> > printing?
> > 
> > Best
> > 
> > Gordon
> > gwalias-bb at yahoo.com
> >
>

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

4. Re: Printing/grabbing window contents

i had sort of the same question, wondering if it were possible to write the
information to a file that would pull up right in WORD, so that they could
edit more, if they wanted to.

Is that possible?  or is it illegal?  heh..or what?
Michelle Rogers
----- Original Message ----- 
From: "Gordon Webster" <guest at RapidEuphoria.com>
To: <EUforum at topica.com>
Sent: Tuesday, June 08, 2004 5:46 PM
Subject: Printing/grabbing window contents


>
>
> posted by: Gordon Webster <gwalias-bb at yahoo.com>
>
> Dear Euphorians
>
> I would like to layout a window with some
> text and perhaps some accompanying images,
> and then be able to print the window as if
> it were a print preview page. What is the
> best way to achieve this with Eu/win3lib?
>
> I don't want my users to have to do any
> ctrl-alt-whatever to manually copy the
> window (or the screen) to the clipboard.
>
> Is there a way to render the contents of
> a window (without its borders, titlebar etc.)
> as postscript or as a bitmap image ready for
> printing?
>
> Best
>
> Gordon
> gwalias-bb at yahoo.com
>
>
>
>

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

5. Re: Printing/grabbing window contents

Found a (partial) example (use your window instead of screen):
sequence dib
integer result

dib = newDib(screen_width, screen_height) -- create the bitmap

copyToDib(dib, Screen, 0, 0, 0, 0, screen_width - 1, screen_height - 1)
-- copy the screen to the bitmap

result = saveDib(dib, "screen.bmp", 0, 0, screen_width - 1, screen_height - 1)
-- save the bitmap to a file(you could also print it somhow)

killDib(dib) -- delete the bitmap


CoJaBo wrote:
> 
> 
> I found copyToDib() in Win32Dibi; this just calls bitBlt(),
> but is a bit easier to use.
> 
> >From Win32Dib docs:
> copyToDib(dib, control, x, y, x1, y1, x2, y2)
> -- draws the rectangular region (x1, y1) -> (x2, y2) from the control on the
> dib at
> -- position (x, y)
> 
> 
> CoJaBo wrote:
> > 
> > 
> > bitBlt() (I think) can do this; copy the window to a DIB
> > (maby created by Win32Dib, therefore allowing you to edit it first),
> > which you can then print.
> > 
> > 
> > Gordon Webster wrote:
> > > 
> > > 
> > > Dear Euphorians
> > > 
> > > I would like to layout a window with some
> > > text and perhaps some accompanying images,
> > > and then be able to print the window as if
> > > it were a print preview page. What is the
> > > best way to achieve this with Eu/win3lib?
> > > 
> > > I don't want my users to have to do any
> > > ctrl-alt-whatever to manually copy the
> > > window (or the screen) to the clipboard.
> > > 
> > > Is there a way to render the contents of
> > > a window (without its borders, titlebar etc.)
> > > as postscript or as a bitmap image ready for
> > > printing?
> > > 
> > > Best
> > > 
> > > Gordon
> > > gwalias-bb at yahoo.com
> > >
> >

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

6. Re: Printing/grabbing window contents

> 
> i had sort of the same question, wondering if it were possible to write the
> information to a file that would pull up right in WORD, so that they could
> edit more, if they wanted to.
> 
> Is that possible?  or is it illegal?  heh..or what?
> Michelle Rogers
> ----- Original Message ----- 
> From: "Gordon Webster" <guest at RapidEuphoria.com>
<sniped> 

If your talking about a whole window or multiple controls w/i graphics
 then that  would involve some major transformation of an image on your
 part.
 If you have all the text information in a rich edit control then you can
 just save the text stream to an RTF file and shell out to word. 

 alternately you could mirror the information presentation in a sequence,
  and embed either rich text or HTML tags to format it, then dump the
  sequence to a file and again shell out to MS-Word. 

  For example, this is a RTF header portion I embed into post-processed
  reports to make the documents pre-defined for landscape printing.
  
puts(df,"{\\rtf1\\ansi\\deff0\\deftab720{\\fonttbl{\\f0\\fswiss Courier
 New;;}")
 puts(df,"{\\f1\\froman\\fcharset2 Ariel;}{\\f2\\fmodern\\fprq1 Courier;}")
puts(df,"{\\f3\\froman Times New
 Roman;}}\n{\\colortbl\\red0\\green0\\blue0;}\n")
puts(df,"{\\info{\\author LDRMail}{\\comment Labor Distribution app by
 M.Raley}{\\*\\company HUGE MEDICAL}}")
puts(df,"{\\header \\pard\\plain \\s15\\widctlpar {\\cgrid0 
 page#}{\\field{\\*\\fldinst {\\cgrid0  PAGE }}")
 puts(df,"{\\fldrslt {\\lang1024\\cgrid0 1}}}{\\par }} ")

puts(df,"\\lndscpsxn\\psz1\\linex0\\sectdefaultcl\\paperw15840\\paperh12240\\viewkind4")
 puts(df,"\\deflang1033\\pard\\plain\\f0\\landscape\\margl706\\margr706\\fs16")
puts(df,"\n\\par\\b\\f3 747      HUGE MEDICAL CENTER                      LABOR
 DISTRIBUTION REPORT\t"
     & Period &"\\plain\\fs16\\f0\n\\par\n\\par")                

 I then just have to prepend "\\par" in front of each line and close 
 the file with 
  
   puts(df,"\\par \\pard\\plain\\f2\\fs16 \n\\par }")
  flush(df)
  close(df)
  

--"ask about our layaway plan".
--

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

Search



Quick Links

User menu

Not signed in.

Misc Menu