Results 1 to 6 of 6

Thread: Please help! Critical printing help needed!

  1. #1

    Thread Starter
    Member
    Join Date
    Jul 1999
    Posts
    51

    Post

    I need to know if the following is possible in vb and if you have any ideas on how to do it that would be a great help.

    1.) Print tiff images (1 or 2 on a single piece of paper. I can print 1 right now)

    2.) Overlay text on the tiff image before printing.

    Any ideas? Thank you for your help.

  2. #2
    Guru Aaron Young's Avatar
    Join Date
    Jun 1999
    Location
    Red Wing, MN, USA
    Posts
    2,177

    Post

    1. If you can't manipulate the Prints sufficiently using the Wang Controls then try Copying the Image to the Clipboard and Pasting it into a Picturebox which gives you more control over the Image, eg.

    Print 2 TIFF Images on 1 Piece of Paper, Add an Invisible Picturebox to your Form..
    Code:
    Private Sub Command1_Click()
        With ImgEdit1
            .Image = "C:\Files\Employee.tif"
            .Display
            .ClipboardCopy 0, 0, .ImageWidth, .ImageHeight
        End With
        Picture1.AutoSize = True
        Picture1 = Clipboard.GetData(vbCFBitmap)
        'Print 2 Copies on the Same Page 1 Under the Other
        Printer.PaintPicture Picture1, 0, 0
        Printer.PaintPicture Picture1, 0, ScaleY(Picture1.Height, Picture1.ScaleMode, Printer.ScaleMode)
        Printer.EndDoc
    End Sub
    2. You can move the Graphics cursor around anywhere on the Printed page before sending the Print to the Printer, so you can easily go back and overlay some Text on a Printed Image, eg.

    Add this before the Printer.EndDoc
    Code:
        Printer.CurrentY = Picture1.ScaleHeight / 2
        Printer.CurrentX = (Printer.Width - Printer.TextWidth("Centered Text")) / 2
        Printer.Print "Centered Text"

    ------------------
    Aaron Young
    Analyst Programmer
    [email protected]
    [email protected]

  3. #3

    Thread Starter
    Member
    Join Date
    Jul 1999
    Posts
    51

    Post

    Where do I get all of the wang source and is there any documentation? I have the project that comes on my computer but it always loads with errrors. Is the full package somewhere to download? I'd love to have the code to insert more than one image in the viewer. I usually have multiple documents that I need to display but don't know how to do it right now in the wang viewer.

    Thanks for your help. I need most of the printing to be automated. These prints need to be done with no user intervention.

    [This message has been edited by desquite (edited 11-25-1999).]

  4. #4

    Thread Starter
    Member
    Join Date
    Jul 1999
    Posts
    51

    Post

    Aaron,

    Thanks so much for your help. I have another question. The piece of code where you print 2 tiff images on the same page works if the images are small. My tiff images are a very large resolution. Any way to scale them down to their width and keep the same ratio?

    Thanks as always.

  5. #5
    Guru Aaron Young's Avatar
    Join Date
    Jun 1999
    Location
    Red Wing, MN, USA
    Posts
    2,177

    Post

    Once you have the Image in the Picturebox you can manipulate it as you would any other Image, eg.

    This Example Halves the Pictures Size before Printing..
    Code:
    Private Sub Command1_Click()
        With ImgEdit1
            .Image = "C:\Files\Employee.tif"
            .Display
            .ClipboardCopy 0, 0, .ImageWidth, .ImageHeight
        End With
        Picture1.AutoSize = True
        Picture1 = Clipboard.GetData(vbCFBitmap)
        With Picture1
            .AutoRedraw = True
            .PaintPicture .Picture, 0, 0, .ScaleWidth / 2, .ScaleHeight / 2, 0, 0, .ScaleWidth, .ScaleHeight
            .Picture = .Image
            .Move 0, 0, .Width / 2, .Height / 2
        End With
        'Print 2 Copies on the Same Page 1 Under the Other
        Printer.PaintPicture Picture1.Image, 0, 0
        Printer.PaintPicture Picture1.Image, 0, ScaleY(Picture1.Height, Picture1.ScaleMode, Printer.ScaleMode)
        Printer.EndDoc
    End Sub
    ------------------
    Aaron Young
    Analyst Programmer
    [email protected]
    [email protected]

  6. #6

    Thread Starter
    Member
    Join Date
    Jul 1999
    Posts
    51

    Post

    Thank you very much Aaron! You've been a great help.

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