Re: Printing/grabbing window contents

new topic     » goto parent     » topic index » view thread      » older message » newer message

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 thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu