CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2000
    Location
    Jhb, Gauteng RSA
    Posts
    21

    INVERSE Printing on Laser

    Hi All,
    I have the following Problem, I need to Print (on a laser) an inverse date
    I have been using code similar to this

    With Printer
    ' Draw Black Box
    Printer.Line (567,567)-(2000,2000),vbBlack,BF
    .CurrentX = 1100
    .CurrentY = 1100 'Resposition
    .ForeColor = vbWhite
    Printer.print format(now(),"dd-mm-yyyy")
    End With
    Printer.EndDoc



    What this should produce (according to my understanding) is White on Black Printed date in the top left corner of the page.
    Yet all I get is a black square.
    I have also experimented with .DrawMode but to no Avail.

    Please Help



  2. #2
    Join Date
    Apr 2000
    Location
    South Carolina,USA
    Posts
    2,210

    Re: INVERSE Printing on Laser


    option Explicit
    ' This sample demonstrates how to overcomea bug in printing text over
    ' an image. Without this solution, Text being printed on top of a
    ' Image has a white box around it.
    '
    ' See Microsoft document Q1457265 for details and the solution which
    ' follows. This demo will print text with a white background and a
    ' transparent background.
    '
    '
    #If Win32 then

    private Declare Function SetBkMode Lib "gdi32" _
    (byval hDC as Long, byval nBkMode as Long) as Long

    private iBKMode as Long

    #else

    private Declare Function SetBkMode Lib "GDI" (byval hDC as Integer _
    , byval nBkMode as Integer) as Integer

    private iBKMode as Integer

    #End If

    private Const TRANSPARENT = 1
    private Const OPAQUE = 2



    private Sub Form_Click()

    Printer.print ""
    Printer.Line (0, 0)-(10000, 2000), &HC0C0C0, BF
    Printer.CurrentX = 0
    Printer.CurrentY = 0
    Printer.FontTransparent = true
    'Correctly sets the background mix mode to transparent
    iBKMode = SetBkMode(Printer.hDC, TRANSPARENT)
    Printer.print "Printer.FontTransparent = " & Printer.FontTransparent
    Printer.FontTransparent = false
    'Correctly sets the background mix mode to opaque
    iBKMode = SetBkMode(Printer.hDC, OPAQUE)
    Printer.print "Printer.FontTransparent = " & Printer.FontTransparent
    Printer.EndDoc

    End Sub






    John G

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured