Printing to my Printer
#5
This worked fine for me, I even had to reload my printer driver and stuff first because working from fresh SSD drive.
Code: (Select All)
'NOTE: THIS ROUTINE DOESN'T WORK ... SUPPOSTED HAVE A WHITE BACKGROUND BUT GETTING AN ALL BLACK INK PAGE


'Printing on the Printer - an example using "_PrintImage" command
'Assumes a menu where an option to print to printer is the letter "p" or "P"

Dim img As Long
Dim Page As Long
Screen _NewImage(800, 600, 32)

PageScale = 2
PageHeight = 297 * PageScale
PageWidth = 210 * PageScale
Page& = _NewImage(PageWidth, PageHeight, 32) ' Page& ready to take an image

a$ = "P"
Text$ = "The Rain in Spain falls mainly in the Plain."
Color _RGB32(0, 0, 0), _RGB32(255, 255, 255)
Cls
Print
Print
Print Text$ 'This text is printing to the screen ok <<<< really? was it black on white back ground?


If a$ = "p" Or a$ = "P" Then ' print it
    ' screen image to page
    _PutImage , 0, Page&
    ' now check out page&
    Screen _NewImage(PageWidth, PageHeight, 32)
    _PutImage , Page&, 0

    _PrintString (10, 297 - 8), "Does this preview look OK? y/n"
    k$ = InKey$
    While k$ <> "y" And k$ <> "n"
        k$ = InKey$
    Wend
    If k$ = "y" Then
        PageScale = 10
        PageHeight = 297 * PageScale
        PageWidth = 210 * PageScale
        Page2& = _NewImage(PageWidth, PageHeight, 32) ' Page& ready to take an image
        _PutImage , Page&, Page2&
        _PrintImage Page2& ' this command is supposed to send the img just captured to the printer
    End If
End If

I used a graphics screen for easy (for me) manipulation of images.

   

The printout was the one line down (one page only) about 1/16 th of page from top black print on white background. The font was as crappy looking as in preview (see snapshot) because your page is not scaled with screen, ie different ratios width x height...
b = b + ...
Reply


Messages In This Thread
Printing to my Printer - by Dimster - 07-12-2022, 03:11 PM
RE: Printing to my Printer - by Pete - 07-12-2022, 05:30 PM
RE: Printing to my Printer - by SierraKen - 07-12-2022, 05:49 PM
RE: Printing to my Printer - by SierraKen - 07-12-2022, 05:50 PM
RE: Printing to my Printer - by bplus - 07-12-2022, 05:53 PM
RE: Printing to my Printer - by Dimster - 07-12-2022, 06:24 PM
RE: Printing to my Printer - by Kernelpanic - 07-12-2022, 09:02 PM
RE: Printing to my Printer - by SierraKen - 07-13-2022, 01:09 AM
RE: Printing to my Printer - by bplus - 07-12-2022, 11:16 PM
RE: Printing to my Printer - by George McGinn - 07-13-2022, 01:25 AM
RE: Printing to my Printer - by Dimster - 07-14-2022, 01:13 PM
RE: Printing to my Printer - by OldMoses - 07-14-2022, 02:39 PM
RE: Printing to my Printer - by Dimster - 07-14-2022, 03:25 PM
RE: Printing to my Printer - by Kernelpanic - 07-14-2022, 03:55 PM
RE: Printing to my Printer - by bplus - 07-14-2022, 04:24 PM
RE: Printing to my Printer - by SMcNeill - 07-14-2022, 05:47 PM
RE: Printing to my Printer - by Dimster - 07-14-2022, 06:33 PM
RE: Printing to my Printer - by SMcNeill - 07-14-2022, 06:54 PM



Users browsing this thread: 4 Guest(s)