C# Класс TemplNET.TemplGraphic

Used to store/load images and generate (scaled) pictures.
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
Alignment Alignment?
Description string
Scalar double
Stream MemoryStream

Защищенные свойства (Protected)

Свойство Тип Описание
Image Novacode.Image

Открытые методы

Метод Описание
Load ( DocX doc ) : TemplGraphic

Load image into document. Required before producing a Picture for the document.

Picture ( ) : Picture

Generate a Picture instance, which can be inserted into a Document

Picture ( double scalar ) : Picture

Generate a Picture instance, which can be inserted into a Document

Picture ( uint width ) : Picture

Generate a Picture instance, which can be inserted into a Document

TemplGraphic ( Stream data, Alignment align = null, double scalar = 1.0, string description = "" ) : System

New graphic from data stream

TemplGraphic ( byte data, Alignment align = null, double scalar = 1.0, string description = "" ) : System

New graphic from file data

TemplGraphic ( string file, Alignment align = null, double scalar = 1.0, string description = "" ) : System

New graphic from filename

Описание методов

Load() публичный Метод

Load image into document. Required before producing a Picture for the document.
public Load ( DocX doc ) : TemplGraphic
doc DocX
Результат TemplGraphic

Picture() публичный Метод

Generate a Picture instance, which can be inserted into a Document
public Picture ( ) : Picture
Результат Picture

Picture() публичный Метод

Generate a Picture instance, which can be inserted into a Document
public Picture ( double scalar ) : Picture
scalar double The scaling factor (0.5 is 50%)
Результат Picture

Picture() публичный Метод

Generate a Picture instance, which can be inserted into a Document
public Picture ( uint width ) : Picture
width uint The width in pixels
Результат Picture

TemplGraphic() публичный Метод

New graphic from data stream
public TemplGraphic ( Stream data, Alignment align = null, double scalar = 1.0, string description = "" ) : System
data Stream
align Alignment
scalar double
description string
Результат System

TemplGraphic() публичный Метод

New graphic from file data
public TemplGraphic ( byte data, Alignment align = null, double scalar = 1.0, string description = "" ) : System
data byte
align Alignment
scalar double
description string
Результат System

TemplGraphic() публичный Метод

New graphic from filename
public TemplGraphic ( string file, Alignment align = null, double scalar = 1.0, string description = "" ) : System
file string
align Alignment
scalar double
description string
Результат System

Описание свойств

Alignment публичное свойство

Alignment when inserting into the document (e.g. Left, Right, Centre). No change in alignment if null
public Alignment? Alignment
Результат Alignment?

Description публичное свойство

String description of the image. Has no automatic function; useful for storing caption text in the model.
public string Description
Результат string

Image защищенное свойство

Underlying DocX image instance Not populated until document build time, as it requires a reference to a DocX document
protected Image,Novacode Image
Результат Novacode.Image

Scalar публичное свойство

Resizing factor when inserting into the document. Maintains aspect ratio
public double Scalar
Результат double

Stream публичное свойство

Image data as memory stream
public MemoryStream Stream
Результат MemoryStream