VintaSoft Imaging .NET SDK 15.2: Documentation for .NET developer
Vintasoft.Imaging Namespace / VintasoftImage Class / VintasoftImage Constructors / VintasoftImage Constructor(ImageSize,PixelFormat)
Syntax Exceptions Example Requirements SeeAlso
In This Topic
VintasoftImage Constructor(ImageSize,PixelFormat)
In This Topic
Initializes a new instance of the VintasoftImage class.
Syntax
'Declaration

Public Function New( _
ByVal size
Size of the image.
As ImageSize, _
ByVal pixelFormat
Pixel format of the image.
As PixelFormat _
)
public VintasoftImage(
ImageSize size,
PixelFormat pixelFormat
)

Parameters

size
Size of the image.
pixelFormat
Pixel format of the image.
Exceptions
ExceptionDescription
Thrown if size has width or height equal to 0 or less.
Example

This C#/VB.NET code shows how to create a gray image with A4 standard size.


' resolution of image
Dim resolution As Vintasoft.Imaging.Resolution = Vintasoft.Imaging.ImagingEnvironment.ScreenResolution
Dim imageSize As Vintasoft.Imaging.ImageSize = Vintasoft.Imaging.ImageSize.FromPaperKind(Vintasoft.Imaging.PaperSizeKind.A4, resolution)
' create a gray image
        ' ...
Using image As New Vintasoft.Imaging.VintasoftImage(imageSize, Vintasoft.Imaging.PixelFormat.Gray8)
End Using


// resolution of image
Vintasoft.Imaging.Resolution resolution = 
    Vintasoft.Imaging.ImagingEnvironment.ScreenResolution;
Vintasoft.Imaging.ImageSize imageSize = 
    Vintasoft.Imaging.ImageSize.FromPaperKind(Vintasoft.Imaging.PaperSizeKind.A4, resolution);
// create a gray image
using (Vintasoft.Imaging.VintasoftImage image = 
    new Vintasoft.Imaging.VintasoftImage(imageSize, 
        Vintasoft.Imaging.PixelFormat.Gray8))
{
    // ...
}

Requirements

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

See Also