×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Print a TIFF image

Print a TIFF image

Print a TIFF image

(OP)
Hi everyone,

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

Any help will be apreciated.

Regards,

MHendler

RE: Print a TIFF image

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.

RE: Print a TIFF image

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.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources