VintaSoft Imaging .NET SDK 12.4: Documentation for .NET developer
Vintasoft.Imaging Namespace / VintasoftImage Class / VintasoftImage Constructors / VintasoftImage Constructor(ImageSize)
Syntax Exceptions Example Requirements SeeAlso
In This Topic
    VintasoftImage Constructor(ImageSize)
    In This Topic
    Initializes a new instance of the VintasoftImage class.
    Syntax
    'Declaration
    
    Public Function New( _
    ByVal size
    Size of the image.
    As ImageSize _
    )
    public VintasoftImage(
    ImageSize size
    )
    public: VintasoftImage(
    ImageSize* size
    )
    public:
    VintasoftImage(
    ImageSize^ size
    )

    Parameters

    size
    Size of the image.
    Exceptions
    ExceptionDescription
    Thrown if size is null.
    Example

    This C#/VB.NET code shows how to create an image of the specified size in millimeters.

    
    ' width of image in millimeters (15 cm)
    Dim width As Integer = 15 * 10
    ' height of image in millimeters (20 cm)
    Dim height As Integer = 20 * 10
    ' resolution of image
    Dim resolution As Vintasoft.Imaging.Resolution = Vintasoft.Imaging.ImagingEnvironment.ScreenResolution
    Dim imageSize As Vintasoft.Imaging.ImageSize = Vintasoft.Imaging.ImageSize.FromMillimeters(width, height, resolution)
    ' create an image width size 15x20 cm
            ' ...
    Using image As New Vintasoft.Imaging.VintasoftImage(imageSize)
    End Using
    
    
    
    // width of image in millimeters (15 cm)
    int width = 15 * 10;
    // height of image in millimeters (20 cm)
    int height = 20 * 10;
    // resolution of image
    Vintasoft.Imaging.Resolution resolution = 
        Vintasoft.Imaging.ImagingEnvironment.ScreenResolution;
    Vintasoft.Imaging.ImageSize imageSize = 
        Vintasoft.Imaging.ImageSize.FromMillimeters(width, height, resolution);
    // create an image width size 15x20 cm
    using (Vintasoft.Imaging.VintasoftImage image = 
        new Vintasoft.Imaging.VintasoftImage(imageSize))
    {
        // ...
    }
    
    

    Requirements

    Target Platforms: .NET 8; .NET 7; .NET 6; .NET Framework 4.8, 4.7, 4.6, 4.5, 4.0, 3.5

    See Also