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 : Sunday, March 20, 2005 1:58:51 AM(UTC)
mgopinath

Groups: Registered
Posts: 1


Hi,

When I invoke lead picturebox.Zoom method, which interpolation mode does it use by default?

There are list of interpolation modes provided by System.Drawing ( http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdrawingdrawing2dinterpolationmodeclasstopic.asp ).

Is there a way, I can set the interpolation mode to be used for Zooming in LEAD PictureBox?

Any help in this regard would be appreciated.

thanks & regards,

Gopi

 

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 : Tuesday, May 3, 2005 12:30:13 PM(UTC)

Kousay  
Kousay

Groups: Registered
Posts: 8


Hello Gopi,

We use the default (Bilinear). You can change the interpolation mode by registering to any of these events:
PreTransformPaint
PreViewPaint
PostViewPaint
PostTransformPaint

For more information about these events, check our help file.
So, you do something like this in your code:

// Register to the PreTransformPaint to change the Graphics object properties
rasterImageViewer1.PreTransformPaint += new PaintEventHandler(rasterImageViewer1_PreTransformPaint);

private void rasterImageViewer1_PreTransformPaint(object sender, PaintEventArgs e)
{
   // change the interpolation mode to Bicubic
   e.Graphics.InterpolationMode = InterpolationMode.Bicubic;
}

You will probably not notice a lot of difference when you change the interpolation mode while the image is “zoomed”.  Internally, we paint the image in bands to save memory, so your interpolation mode is applied only to one band.  A better option is to use our RasterPaintDisplayModeFlags.None/Resample/Bicubic for that purpose.  This way, banding is taken into consideration.  Something like this:

RasterPaintProperties props = rasterImageViewer1.PaintProperties;
// Default is “None”, change the LEADTOOLS interpolation mode to Bicubic
props.PaintDisplayMode |= RasterPaintDisplayModeFlags.Bicubic;
rasterImageViewer1.PaintProperties = props;


Again, for more info about RasterPaintDisplayModeFlags, please check our documentation.

Regards,
Kousay Alani
LEAD Technologies, Inc.

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