Error processing SSI file
(Leadtools.Controls)

Show in webframe

TranslateItemScaleFactor Method




The item to translate. This parameter cannot be null.
Number of pixels to translate the item horizontally.
Number of pixels to translate the item vertically.
true to reset the item state transformations, otherwise; false.
Translates an item horizontally or vertically a given amount of pixels regardless of the current zoom value.
Syntax
public void TranslateItemScaleFactor( 
   ImageViewerItem item,
   double dx,
   double dy,
   bool resetValues
)
'Declaration
 
Public Sub TranslateItemScaleFactor( _
   ByVal item As ImageViewerItem, _
   ByVal dx As Double, _
   ByVal dy As Double, _
   ByVal resetValues As Boolean _
) 

Parameters

item
The item to translate. This parameter cannot be null.
dx
Number of pixels to translate the item horizontally.
dy
Number of pixels to translate the item vertically.
resetValues
true to reset the item state transformations, otherwise; false.
Remarks

This is a helper method to quickly transform an item a specified amount of pixels regardless of the current zoom value.

Example

This example will add a few items to the ImageViewer and then create a new interactive mode that transform the item using mouse or touch.

Run the demo. Click on any item and drag to translate, CTRL-click to zoom the item in and out.

Start with the ImageViewer example, remove all the code inside the example function (search for the "// TODO: add example code here" comment) and insert the following code:

Copy Code  
Imports Leadtools
Imports Leadtools.Controls
Imports Leadtools.Codecs
Imports Leadtools.Drawing
Imports Leadtools.ImageProcessing
Imports Leadtools.ImageProcessing.Color

Public Sub ImageViewerTranslateItemScaleFactor_Example(ByVal dx As Integer, ByVal dy As Integer)
   If dx = 0 AndAlso dy = 0 Then
      Return
   End If
   _imageViewer.TranslateItemScaleFactor(_imageViewer.ActiveItem, -dx, -dy, True)
End Sub
using Leadtools;
using Leadtools.Controls;
using Leadtools.Codecs;
using Leadtools.Drawing;
using Leadtools.ImageProcessing;
using Leadtools.ImageProcessing.Color;

public void ImageViewerTranslateItemScaleFactor_Example(int dx, int dy)
{
   if (dx == 0 && dy == 0)
      return;
   _imageViewer.TranslateItemScaleFactor(_imageViewer.ActiveItem, -dx, -dy, true);
}
Requirements

Target Platforms

See Also

Reference

ImageViewer Class
ImageViewer Members

Error processing SSI file