BBC BASIC for Windows
« Print Preview »

Welcome Guest. Please Login or Register.
Apr 5th, 2018, 9:55pm



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

If you require a dump of the post on your message board, please come to the support board and request it.


Thank you Conforums members.

BBC BASIC for Windows Resources
Online BBC BASIC for Windows documentation
BBC BASIC for Windows Beginners' Tutorial
BBC BASIC Home Page
BBC BASIC on Rosetta Code
BBC BASIC discussion group
BBC BASIC for Windows Programmers' Reference

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Print Preview  (Read 1334 times)
Matt
Developer

member is offline

Avatar




PM

Gender: Male
Posts: 210
xx Print Preview
« Thread started on: May 21st, 2013, 7:13pm »

Hi,

Is there a Windows Print Preview utility that can be called, or would any print preview screen need to be completely set up from scratch?

Matt
User IP Logged

admin
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 1145
xx Re: Print Preview
« Reply #1 on: May 22nd, 2013, 08:22am »

on May 21st, 2013, 7:13pm, Matt wrote:
Is there a Windows Print Preview utility that can be called, or would any print preview screen need to be completely set up from scratch?

There's some support in .NET but that's not a lot of use to a BB4W programmer, so realistically you would need to create your own.

It's not too difficult, however. The way I would probably do it is to write all my 'printing' routines so that they take as a parameter the output DC. Then when printing normally I would pass @prthdc% as the parameter, and when doing the Print Preview I'd pass a memory DC that I had created for the purpose.

That way exactly the same code is being used to output to the Print Preview as to the printer itself, which is the best way to guarantee an accurate preview.

Richard.
User IP Logged

Matt
Developer

member is offline

Avatar




PM

Gender: Male
Posts: 210
xx Re: Print Preview
« Reply #2 on: May 23rd, 2013, 05:31am »

Thanks Richard.

on May 22nd, 2013, 08:22am, Richard Russell wrote:
The way I would probably do it is to write all my 'printing' routines so that they take as a parameter the output DC. Then when printing normally I would pass @prthdc% as the parameter, and when doing the Print Preview I'd pass a memory DC that I had created for the purpose.
Richard.


To be honest, I'm not sure what most of this means as I haven't done much with device contexts specifically. Any printing I've done has been directly through VDU2, etc. or through creating an HTM document and then executing that file. So doing this with @prthdc% is new to me. However, I'll have a go and see what I can do. Any pointers would be appreciated, though.

Thanks

Matt
User IP Logged

admin
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 1145
xx Re: Print Preview
« Reply #3 on: May 23rd, 2013, 09:06am »

on May 23rd, 2013, 05:31am, Matt wrote:
Any printing I've done has been directly through VDU2, etc.

In that case you might be able to do the Print Preview by creating a memory DC compatible with @prthdc%, temporarily setting @prthdc% to your temporary DC, doing the normal print output, and then restoring @prthdc% to its previous value (followed by blitting the temporary DC to your preview window of course).

It's not something I've tried, but it sounds relatively straightforward and also quite interesting. Maybe if it can be made to work it could be developed into a BB4W 'print preview' library. If that's something you would like to attempt I'm sure the BB4W user community would be extremely grateful!

Richard.
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls