Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Print a TIFF image

Status
Not open for further replies.

MHendler

Mechanical
Mar 28, 2002
35
BR
Hi everyone,

How can I print a TIFF file using VB6.0?

Any help will be apreciated.

Regards,

MHendler
 
Replies continue below

Recommended for you

Not sure if this helps (or works), but Windows comes with Imaging.
Maybe you could load the TIFF file into Imaging and then print it from there.
 
Visual basic 6 doesn't support “*.tif” files.
Visual basic 6 loads pictures in image or picture box controls.
And loads only pictures with the: “*.bmp”, “*.cur”, “*.dib”,“*.emf”, “*.gif”,“*.ico”, “*.jpg” or “*.wmf” extensions.

You have to change extension from “*.tif” to for example “*.bmp” (how to do that: open “*.tif” file with “Paint” and Save As like “*.bmp” file) and then put into your VB project:
For example:
1. ImgMyPicture.Picture = LoadPicture(App.Path & "\OnePicture.bmp")
‘one way
2. Or in design mode, load the picture, in image or picture box
controls, in their properties. - other way

For printing image files VB6 uses Printer object and
PaintPicture method for example:


Sub PrintPictires()
Dim c As Control

For Each c In Controls
If TypeOf c Is Image Then

Printer.CurrentX = c.Left
Printer.CurrentY = c.Top

Printer.PaintPicture c.Picture, c.Left, c.Top
End If

If TypeOf c Is PictureBox Then

Printer.CurrentX = c.Left
Printer.CurrentY = c.Top

c.AutoSize = True
c.Refresh
c.AutoSize = False

Printer.PaintPicture c.Picture, c.Left, c.Top

End If

Next c

Printer.EndDoc

End Sub

Maybe this will help you.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top