Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can I print a .TIFF file ?
Message
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00390349
Message ID:
00390728
Views:
9
>>At first make a form and insert two ActiveX controls: Kodak Image Admin (ctlImageAdmin) and Kodak Image Edit (ctlImageEdit). Then insert a command button (cmdPrint).
>>
>>
>>In form Load event put code:
>>    ' initial settings
>>    With Me.ctlImageEdit.Object
>>        .AutoRefresh = True
>>        .SelectionRectangle = False
>>        .ScrollShortcutsEnabled = True
>>        .DisplayScaleAlgorithm = wiScaleOptimize   ' 4
>>        .ImagePalette = wiPaletteGray8   ' 2 - I don't work with colors.
>>    End With
>>
>>    ' variable strFullFileName contains the full file name (with path). You
>>    ' can use UNC here.
>>    ' We start from the first page.
>>    With Me.ctlImageAdmin.Object
>>        .Image = strFullFileName
>>        .PageNumber = 1
>>    End With
>>
>>    With Me.ctlImageEdit.Object
>>        .Image = Me.ctlImageAdmin.Object.Image
>>        .Page = 1
>>        .Display   ' display the image
>>    End With
>>
>>In Click event of cmdPrint put the code:
>>
>>    With Me.ctlImageEdit.Object
>>        nFromPage = .Page
>>        nToPage = .Page
>>        nHowToPrint = 2 ' 0 -Pixel to pixel, 1 -Inch to inch (default), 2 -Fit to page
>>        bPrintAnnotation = True
>>        .PrintImage nFromPage, nToPage, nHowToPrint, bPrintAnnotation
>>    End With
>>' Note: PrintImage method has several more parameters, which I don't use.
>>
>>
>>The code above is written in VB, but you can easily convert it to VFP.
>>
>>HTH, Igor
>
>Thank you very much, by the way 'easily convert to VFP' is easy to say...:)

Change Me to be thisform, True and False to .t. and .f.
.PrintImage(nFromImage, nToPage, nHowToPrint, bPrintAnnotation).

Not sure about constants, you probably should either use .h file or set the real values (8 and 2). Other than that I don't see any problems... The code is really straightforward.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform