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 : Wednesday, August 31, 2005 11:32:18 AM(UTC)
caddsman

Groups: Registered
Posts: 14


Hello,

Is there a method exposed in your program to scale images to fit inside the viewer without having to write my own code, and if so, what is the method?

 

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 : Thursday, September 1, 2005 3:10:04 AM(UTC)
michael.loux

Groups: Registered
Posts: 11


Heya,

Probably the easiest way is to use the SizeMode property:

RasterImageViewer1.SizeMode = RasterViewerSizeMode.FitWidth

"FitWidth" will fit the image to the width of the viewer.  "Fit" will attempt to fit the entire image.


The alternative is to set the scale factor manually.  I do this
when I want to fit an image to the viewer width.  "leadViewer" is
my RasterImageViewer object.

    With leadViewer
        ' Turn off fit-to-width mode
        .SizeMode = RasterViewerSizeMode.Normal

        ' Figure the scale factor, allowing for the vertical scrollbar space

        .ScaleFactor = (.Width - 15) / .Image.Width

        ' Force a repaint & turn on refresh
        .Invalidate()
    End With

HTH!
 
#3 Posted : Monday, September 5, 2005 4:00:56 AM(UTC)

Bashar  
Guest

Groups: Guests
Posts: 3,022

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

Mike is right.  The best way to fit an image inside the viewer is by setting the SizeMode property to Fit.

Bashar Abdulqaiyume
 
#4 Posted : Thursday, September 8, 2005 4:40:10 AM(UTC)
caddsman

Groups: Registered
Posts: 14


Thanks. Setting the sizemode did the trick.

Signed,

Appreciative newbe

 
#5 Posted : Wednesday, November 22, 2006 2:13:29 AM(UTC)

Newbie1  
Newbie1

Groups: Registered
Posts: 1


Having set the sizemode to e.g. "FitWidth"  how do I determine the effective scalefactor in order that I can display the new 'scale %' to the user?

Thanks

 

 
#6 Posted : Thursday, November 23, 2006 12:08:25 AM(UTC)

Adnan Ismail  
Guest

Groups: Guests
Posts: 3,022

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




Can you tell me what LEADTOOLS programming interface (API,
OCX, COM, C++ classes, etc.) you are using? Also, what is the programming language you are developing your application under?
 
#7 Posted : Thursday, May 31, 2007 11:13:17 AM(UTC)

bsuresh  
bsuresh

Groups: Registered
Posts: 32


Hi,
I am using 15 and c#. I don't want to use sizemode other than Normal (because it doesn't support up my scalefactor values). So how can provide following options with sizemode as normal?

- Fit to width
- Fit to height
- Strech to viewer

Thanks in advance,
Suresh
 
#8 Posted : Sunday, June 3, 2007 12:31:51 AM(UTC)

Adnan Ismail  
Guest

Groups: Guests
Posts: 3,022

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

Suresh,

You can try and use the "RasterPaintSizeMode" to determine how to fit the image in the destination rectangle (Viwer). For more information, please see the help topic "RasterPaintSizeMode Enumeration"

 
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-2024, Yet Another Forum.NET
This page was generated in 0.121 seconds.