Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Tuesday, April 4, 2006 2:45:55 AM(UTC)

rolando  
rolando

Groups: Registered
Posts: 5


Hello,

if I load with lead ocx with autofit property this file I receive a bad stretch.

With zetafax viewer doesn't happen.

This only with some file like this. Not with all the G3N file.

Someone can help me ?

thanks

Renato
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Saturday, April 8, 2006 11:38:33 PM(UTC)

Bashar  
Guest

Groups: Guests
Posts: 3,040

Was thanked: 1 time(s) in 1 post(s)

Try setting the PaintSizeUseDPI property to True.

 
#3 Posted : Monday, April 10, 2006 10:49:22 PM(UTC)

rolando  
rolando

Groups: Registered
Posts: 5


I tryet it and it works!

The only problem now is to correctly print it.

I have tryed with:

    With leadImg
            .PaintSizeUseDPI = True
            .Load CurrFile, 0, CurrPage, -1

        If .RgnHeight > .RgnWidth Then
'            Printer.Orientation = vbPRORPortrait
        Else
'            Printer.Orientation = vbPRORLandscape
             .Rotate 9000, ROTATE_RESAMPLE Or ROTATE_RESIZE, RGB(255, 255, 255)
        End If

        Printer.Print Now
        .StretchIntensity

        .SetSrcRect .RgnLeft, .RgnTop, .RgnWidth, .RgnHeight

        .Render Printer.hDC, 0, 0, 0, 0

        .SetSrcRect 0, 0, .BitmapWidth, .BitmapHeight

[...]

but still print image strecched.

Any suggestion ?

with thanks

Renato
 
#4 Posted : Thursday, April 13, 2006 9:54:52 AM(UTC)

Amin  
Amin

Groups: Manager, Tech Support
Posts: 353


Renato,
The Render method prints without taking the PaintSizeUseDPI property into consideration.


If you want the image's DPI values to be used, you have to calculate
the appropriate values for the fWidth and fHeight parameters of the
Render method. For an example showing how to do this, see the help
topic "Print a Real Image Size in Inches (Visual Basic)" in the OCX help file.

Amin Dodin

Senior Support Engineer
LEAD Technologies, Inc.
LEAD Logo
 
#5 Posted : Monday, April 17, 2006 10:52:26 PM(UTC)

rolando  
rolando

Groups: Registered
Posts: 5


Thanks,

I arrived to this code that works fine:

Dim fRealWidth As Double ' Image's real width in inches
Dim fRealHeight As Double ' Image's real height in inches
Dim fPrnDPIX As Double ' Number of pixels per logical inch along the screen width
Dim fPrnDPIY As Double ' Number of pixels per logical inch along the screen height
Dim hdc As Long


[...]
    With leadPrinter
        .EnableProgressEvent = True
        .PaintSizeUseDPI = True

        fRealWidth = .BitmapWidth / .BitmapXRes
        fRealHeight = .BitmapHeight / .BitmapYRes
       
        Printer.Print Now
        .StretchIntensity
       
        If fRealHeight > fRealWidth Then
            If Printer.Orientation <> vbPRORPortrait Then
                .Rotate 9000, ROTATE_RESAMPLE Or ROTATE_RESIZE, RGB(255, 255, 255)
                .Render Printer.hdc, 1, 1, Printer.PrintQuality * fRealHeight, Printer.PrintQuality * fRealWidth
            Else
                .Render Printer.hdc, 1, 1, Printer.PrintQuality * fRealWidth, Printer.PrintQuality * fRealHeight
            End If
        Else
            If Printer.Orientation = vbPRORLandscape Then
                 .Rotate 9000, ROTATE_RESAMPLE Or ROTATE_RESIZE, RGB(255, 255, 255)
                .Render Printer.hdc, 1, 1, Printer.PrintQuality * fRealHeight, Printer.PrintQuality * fRealWidth
            Else
                .Render Printer.hdc, 1, 1, Printer.PrintQuality * fRealWidth, Printer.PrintQuality * fRealHeight
            End If
        End If

        .EnableProgressEvent = False
    End With
[...]

greetings

Renato
 
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2019, Yet Another Forum.NET
This page was generated in 0.183 seconds.