ClearImage .NET API
ScaleImage Method (CiTools)
Example 





Inlite.ClearImage Namespace > CiTools Class : ScaleImage Method
Scale factor in horizontal direction
Scale factor in vertical direction
Scale image
Syntax
'Declaration
 
Public Function ScaleImage( _
   ByVal ScaleX As System.Double, _
   ByVal ScaleY As System.Double _
) As System.Integer
'Usage
 
Dim instance As CiTools
Dim ScaleX As System.Double
Dim ScaleY As System.Double
Dim value As System.Integer
 
value = instance.ScaleImage(ScaleX, ScaleY)
public System.int ScaleImage( 
   System.double ScaleX,
   System.double ScaleY
)
public function ScaleImage( 
    ScaleX: System.Double;
    ScaleY: System.Double
): System.Integer; 
public function ScaleImage( 
   ScaleX : System.double,
   ScaleY : System.double
) : System.int;
public:
System.int ScaleImage( 
   System.double ScaleX,
   System.double ScaleY
) 

Parameters

ScaleX
Scale factor in horizontal direction
ScaleY
Scale factor in vertical direction
Remarks

When ScaleX or ScaleY are less than 1.0 bi-tonal image is converted to grayscale before scaling. Then it is converted back to bi-tonal applying pScaleType  and pScaleThreshold properties.

Image.HorzDpi and Image.VertDpi properties are multiplied by ScaleX and ScaleY respectively.

This method generates an error if object.Image.IsZone is true.

Example
void ScaleImage(string imageFile, string imageFileOut)
{
    // Open image file
    CiServer ci = Inlite.ClearImageNet.Server.GetThreadServer();
    CiTools Tools = ci.CreateTools();
    Tools.Image.Open(imageFile, 1);
    Tools.ScaleImage(0.5, 0.5);
    // Save results
    Tools.Image.SaveAs(imageFileOut, EFileFormat.ciEXT);
}
Sub ScaleImage(imageFile As String, imageFileOut As String)
    ' Open image file
    Dim ci As CiServer = Inlite.ClearImageNet.Server.GetThreadServer()
    Dim Tools As CiTools = ci.CreateTools()
    Tools.Image.Open(imageFile, 1)
    Tools.ScaleImage(0.5, 0.5)
    ' Save results
    Tools.Image.SaveAs(imageFileOut, EFileFormat.ciEXT)
End Sub
See Also

Reference

CiTools Class
CiTools Members