Wrox Programmer Forums
|
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 1st, 2004, 01:47 PM
Registered User
 
Join Date: Oct 2003
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Printing Images in VB

Hello everyone,

Has anyone had any experience with printing TIFF images programmatically using VB and Kodak Image Edit and Image Admin Controls?
A small piece of working code would be greatly appreciated.


Thank you in advance.


 
Old July 21st, 2004, 10:03 PM
Registered User
 
Join Date: Mar 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

1. Create a VB project
2. Include the Kodak Image Edit and Admin controls
3. Create a form
4. Add the Kodak Image Edit and Admin controls onto the form
5. Name the Image Edit control edtMain and the Image Admin control admMain
6. Add 2 command buttons onto the form - name them cmdOpen and cmdPrint
7. Include the following code into the form
8. You're ready to go

***********************************************
Private Sub cmdOpen_Click()

On Error GoTo err_handler

    admMain.Filter = "All Images Files|*.bmp;*.jpg;*.tif|" & _
        "Bitmap Files(*.bmp)|*.bmp|JPG Files(*.jpg)|*.jpg|TIFF Files(*.tif)|*.tif|"
    admMain.ShowFileDialog OpenDlg, Me.hWnd

    edtMain.Image = admMain.Image
    edtMain.Display

    Exit Sub

err_handler:

    'Do nothing

End Sub

Private Sub cmdPrint_Click()

On Error GoTo err_handler

    If edtMain.Image <> "" Then

        admMain.PrintNumCopies = 1
        admMain.Image = edtMain.Image 'Very important
        admMain.ShowPrintDialog Me.hWnd
        edtMain.PrintImage admMain.PrintStartPage, admMain.PrintEndPage, _
            admMain.PrintOutputFormat, admMain.PrintAnnotations

    End If

err_handler:

    'Do nothing

End Sub
***********************************************

for more info:
http://www.ilixis.com/developer/kodak.html






Similar Threads
Thread Thread Starter Forum Replies Last Post
Printing Images in crystal reports Ujji2006 Crystal Reports 0 September 12th, 2006 11:23 AM
Saving,printing and editng images through vb.net Paru General .NET 2 April 2nd, 2005 12:12 PM
Printing Images in VB sgluzberg Pro VB 6 0 June 1st, 2004 01:37 PM
Printing Images amantona Crystal Reports 5 May 6th, 2004 04:41 AM
Printing in VB sathisemail VB How-To 0 March 10th, 2004 02:29 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.