VintaSoft Imaging .NET SDK v8.7
Vintasoft.Imaging Namespace / VintasoftImage Class / VintasoftImage Constructor / VintasoftImage Constructor(ImageSize,PixelFormat)
Size of the image.
Pixel format of the image.
Example



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 As ImageSize, _
       ByVal pixelFormat As PixelFormat _
    )
    public VintasoftImage( 
       ImageSize size,
       PixelFormat pixelFormat
    )
    public: VintasoftImage( 
       ImageSize* size,
       PixelFormat 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 example shows how to create a gray image with A4 standard size.
    ' resolution of image
    Dim resolution As Vintasoft.Imaging.Resolution = Vintasoft.Imaging.Resolution.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.Resolution.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: Windows 10, Windows 8, Windows 7, Windows Vista, Windows XP, Windows Server 2012, Windows Server 2008, Windows Server 2003

    See Also