PDA

Click to See Complete Forum and Search --> : Please help! Critical printing help needed!


desquite
Nov 23rd, 1999, 08:50 PM
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.

Aaron Young
Nov 24th, 1999, 01:34 AM
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..

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

Printer.CurrentY = Picture1.ScaleHeight / 2
Printer.CurrentX = (Printer.Width - Printer.TextWidth("Centered Text")) / 2
Printer.Print "Centered Text"



------------------
Aaron Young
Analyst Programmer
aarony@redwingsoftware.com
adyoung@win.bright.net

desquite
Nov 24th, 1999, 12:28 PM
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).]

desquite
Nov 29th, 1999, 03:04 AM
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.

Aaron Young
Nov 29th, 1999, 03:53 AM
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..

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
aarony@redwingsoftware.com
adyoung@win.bright.net

desquite
Nov 29th, 1999, 08:46 PM
Thank you very much Aaron! You've been a great help.