VintaSoft Imaging .NET SDK 14.0: Документация для .NET разработчика
Vintasoft.Imaging Namespace / VintasoftImage Class / VintasoftImage Constructors / VintasoftImage Constructor(ImageSize)
Синтаксис Exceptions Example Требования Смотрите также
В этом разделе
    VintasoftImage Constructor(ImageSize)
    В этом разделе
    Инициализирует новый экземпляр класса VintasoftImage.
    Синтаксис
    'Declaration
    
    Public Function New( _
    ByVal size
    Размер изображения.
    As ImageSize _
    )
    public VintasoftImage(
    ImageSize size
    )
    public: VintasoftImage(
    ImageSize* size
    )
    public:
    VintasoftImage(
    ImageSize^ size
    )

    Parameters

    size
    Размер изображения.
    Исключения
    ИсключениеОписание
    Выбрасывается, если size имеет значение NULL.
    Пример

    Вот C#/VB.NET код, который демонстрирует, как создать изображение указанного размера в миллиметрах.

    
    ' 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))
    {
        // ...
    }
    
    

    Требования

    Целевые платформы: .NET 8; .NET 7; .NET 6; .NET Framework 4.8, 4.7, 4.6, 4.5, 4.0, 3.5

    Смотрите также