Posts: 382
Threads: 56
Joined: Apr 2022
Reputation:
13
Thanks a lot bplus. I'm now printing in color but I am puzzled about why the screen size matters? It seemed that the coding at the very beginning was setting up the scaling factor to convert what ever screen size you had to standard page size in a printer. If the following code from the wiki on _Printimage, isn't scaling what's on the screen for a standard page in a printer what exactly is it for?
Page Scale = 2
PageHeight = 297 * PageScale
PageWidth = 210 * PageScale
Page&= _NewImage(PageWidth, PageHeight,32)
Posts: 276
Threads: 14
Joined: Apr 2022
Reputation:
27
I recently had occasion to print multiple pages of text from a harvest truck load database. The setup was fairly straightforward.
DO
pn% = pn% + 1
REDIM _PRESERVE pg(pn%) AS LONG
pg(pn%) = _NEWIMAGE(640, 900, 32)
_DEST pg(pn%)
COLOR &HFF000000, _RGB32(255)
CLS
'then do the line by line stuff with a for-next loop to control row LOCATE and then setting an alldone% flag when finished
'other code with in the for-next loop to control when a page breaks
LOOP UNTIL alldone%
The 640 x 900 yields a precise 80 column by 56 row relationship.
DO: LOOP: DO: LOOP
sha_na_na_na_na_na_na_na_na_na:
Posts: 382
Threads: 56
Joined: Apr 2022
Reputation:
13
Thanks OldMoses I'll give it a try. Prefer not to file _Putimage , as suggested, at this time.
Posts: 3,964
Threads: 176
Joined: Apr 2022
Reputation:
219
It's a question of do you want to print text ?or do you want an image similar to the one you've drawn on screen?
If you want to print text why not use your favorite text editor that has been professionally designed for the job with all kinds of bells and whistles.
For images you've got printed / drawn on screen, what I had assumed Dimster was after, use page dimensions similar to screen or do the math and turn the page sideways with a little more complex _putimage or rotozoom command. BTW another _PutImage option is draw the printer page exactly in proportion to screen 1 pixel for 1 pixel and leave probably the lower half of printed page blank, or center it on printed page. It's not like you don't have plenty of options with _putimage or rotozoom.
Print Text? or Print Image (of Text Plus...)?
b = b + ...
Posts: 382
Threads: 56
Joined: Apr 2022
Reputation:
13
It works great Steve, thanks for same.
I did not appreciate the difference between Text on a screen and an Image on a screen. I thought the wiki was providing a screen dump no matter what was on the screen. That, no matter what the dimensions of the screen I was using, the program simply scaled to printer paper size and printed it. The larger the screen (2000,1000,32), the smaller the print would look on the printer paper.
Live and learn, live and learn and never ever think you know it all. Thanks again