VintaSoft Imaging .NET SDK v8.5
VintasoftImage Class
Members  Example 



Vintasoft.Imaging Namespace : VintasoftImage Class
Contains information about a raster or vector image.
Object Model
VintasoftImage ClassBitmapChannelsFormat ClassColorSpaceFormat ClassDecodingSettings ClassVintasoftImageMetadata ClassPalette ClassRenderingSettings ClassResolution StructureImageSourceInfo ClassThumbnail Class
Syntax
'Declaration
 
<EditorAttribute(EditorBaseTypeName="System.Drawing.Design.UITypeEditor, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", EditorTypeName=".50, Vintasoft.Imaging, Version=8.5.0.1, Culture=neutral, PublicKeyToken=153caf29a10d2e31")>
<LicenseProviderAttribute(Vintasoft.Imaging.VintasoftLicenseProvider)>
<SerializableAttribute()>
Public NotInheritable Class VintasoftImage 
[Editor(EditorBaseTypeName="System.Drawing.Design.UITypeEditor, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", EditorTypeName=".50, Vintasoft.Imaging, Version=8.5.0.1, Culture=neutral, PublicKeyToken=153caf29a10d2e31")]
[LicenseProvider(Vintasoft.Imaging.VintasoftLicenseProvider)]
[Serializable()]
public sealed class VintasoftImage 
[Editor(EditorBaseTypeName="System.Drawing.Design.UITypeEditor, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", EditorTypeName=".50, Vintasoft.Imaging, Version=8.5.0.1, Culture=neutral, PublicKeyToken=153caf29a10d2e31")]
[LicenseProvider(Vintasoft.Imaging.VintasoftLicenseProvider)]
[Serializable()]
public __gc __sealed class VintasoftImage 
[Editor(EditorBaseTypeName="System.Drawing.Design.UITypeEditor, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", EditorTypeName=".50, Vintasoft.Imaging, Version=8.5.0.1, Culture=neutral, PublicKeyToken=153caf29a10d2e31")]
[LicenseProvider(Vintasoft.Imaging.VintasoftLicenseProvider)]
[Serializable()]
public ref class VintasoftImage sealed 
Remarks
Image can be loaded from file, stream or bitmap. The following formats are supported:
Important: Only the first image will be accessible if the source image is a multipage file or image. The ImageCollection class must be used if all images of multipage image should be accessed.

The following image parameters can be get without reading image data:
Image can be saved to file or stream. The following formats are supported:
Example
This example shows how to get the image info about the image loaded from disk, invert the image, save the image, change pixel format of the image.
Imports System.Windows.Forms
            
Imports Vintasoft.Imaging
Imports Vintasoft.Imaging.ImageProcessing
            
            
Class VintasoftImageExample
    Public Sub GetImageInfo()
        ' load an image from disk
        ' [ do not forget to set your image file path here! ]
        Dim image As New VintasoftImage("c:\original-image.tif")
            
        ' get the image info
        Dim imageInfo As String = String.Format("Image info: Width={0}, Height={1}, Resolution={2}, PixelFormat={3}", image.Width, image.Height, image.Resolution, image.PixelFormat)
            
        ' Please notice: image data is still not loaded here because 
        ' we have called only metadata info.
        ' So, image data is loading only when it really needs.
            
        MessageBox.Show(imageInfo)
    End Sub
            
    Public Sub InvertImage()
        ' load an image from disk
        ' [ do not forget to set your image file path here! ]
        Dim image As New VintasoftImage("c:\original-image.tif")
            
        ' invert image
        image.Invert()
            
        ' save the processed image to the new file
        image.Save("c:\processed-image.tif")
    End Sub
            
    Public Sub ConvertTo48Bpp()
        ' [ do not forget to set your image file path here! ]
        ' open an existing image
        Dim image As New VintasoftImage("c:\original-image.tif")
            
        ' create the PixelFormat conversion command
        Dim command As New ChangePixelFormatCommand(PixelFormat.Bgr48)
        ' subscribe to progress event
        AddHandler command.Progress, New EventHandler(Of ImageProcessingProgressEventArgs)(AddressOf command_Progress)
            
        Try
            ' execute the command
            command.ExecuteInPlace(image)
        Catch ex As ImageProcessingException
            ' show error message if problem occured
            MessageBox.Show(ex.Message)
            Return
        End Try
            
        ' save the processed image to the new file
        image.Save("G:\processed-image.tif")
    End Sub
            
    Private Sub command_Progress(sender As Object, e As ImageProcessingProgressEventArgs)
        ' update progress info using e.Progress property
        ' ...
            
        ' cancel execution of command using e.Cancel property if necessary
        ' ...
    End Sub
End Class
using System;
using System.Windows.Forms;
            
using Vintasoft.Imaging;
using Vintasoft.Imaging.ImageProcessing;
            
            
class VintasoftImageExample
{
    public void GetImageInfo()
    {
        // load an image from disk
        // [ do not forget to set your image file path here! ]
        VintasoftImage image = new VintasoftImage(@"c:\original-image.tif");
            
        // get the image info
        string imageInfo = string.Format(
            "Image info: Width={0}, Height={1}, Resolution={2}, PixelFormat={3}",
            image.Width,
            image.Height,
            image.Resolution,
            image.PixelFormat);
            
        // Please notice: image data is still not loaded here because 
        // we have called only metadata info.
        // So, image data is loading only when it really needs.
            
        MessageBox.Show(imageInfo);
    }
            
    public void InvertImage()
    {
        // load an image from disk
        // [ do not forget to set your image file path here! ]
        VintasoftImage image = new VintasoftImage(@"c:\original-image.tif");
            
        // invert image
        image.Invert();
            
        // save the processed image to the new file
        image.Save(@"c:\processed-image.tif");
    }
            
    public void ConvertTo48Bpp()
    {
        // [ do not forget to set your image file path here! ]
        // open an existing image
        VintasoftImage image = new VintasoftImage(@"c:\original-image.tif");
            
        // create the PixelFormat conversion command
        ChangePixelFormatCommand command = new ChangePixelFormatCommand(PixelFormat.Bgr48);
        // subscribe to progress event
        command.Progress += new EventHandler<ImageProcessingProgressEventArgs>(command_Progress);
            
        try
        {
            // execute the command
            command.ExecuteInPlace(image);
        }
        catch (ImageProcessingException ex)
        {
            // show error message if problem occured
            MessageBox.Show(ex.Message);
            return;
        }
            
        // save the processed image to the new file
        image.Save(@"G:\processed-image.tif");
    }
            
    void command_Progress(object sender, ImageProcessingProgressEventArgs e)
    {
        // update progress info using e.Progress property
        // ...
            
        // cancel execution of command using e.Cancel property if necessary
        // ...
    }
}
Inheritance Hierarchy

System.Object
   Vintasoft.Imaging.VintasoftImage

Requirements

Target Platforms: Windows 10, Windows 8, Windows 7, Windows Vista, Windows XP, Windows Server 2012, Windows Server 2008, Windows Server 2003

See Also

Reference

VintasoftImage Members
Vintasoft.Imaging Namespace