C# Class TemplNET.TemplGraphic

Used to store/load images and generate (scaled) pictures.
Afficher le fichier Open project: CPonty/templ-dot-net Class Usage Examples

Méthodes publiques

Свойство Type Description
Alignment Alignment?
Description string
Scalar double
Stream MemoryStream

Protected Properties

Свойство Type Description
Image Novacode.Image

Méthodes publiques

Méthode Description
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

Method Details

Load() public méthode

Load image into document. Required before producing a Picture for the document.
public Load ( DocX doc ) : TemplGraphic
doc DocX
Résultat TemplGraphic

Picture() public méthode

Generate a Picture instance, which can be inserted into a Document
public Picture ( ) : Picture
Résultat Picture

Picture() public méthode

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%)
Résultat Picture

Picture() public méthode

Generate a Picture instance, which can be inserted into a Document
public Picture ( uint width ) : Picture
width uint The width in pixels
Résultat Picture

TemplGraphic() public méthode

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
Résultat System

TemplGraphic() public méthode

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
Résultat System

TemplGraphic() public méthode

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
Résultat System

Property Details

Alignment public_oe property

Alignment when inserting into the document (e.g. Left, Right, Centre). No change in alignment if null
public Alignment? Alignment
Résultat Alignment?

Description public_oe property

String description of the image. Has no automatic function; useful for storing caption text in the model.
public string Description
Résultat string

Image protected_oe property

Underlying DocX image instance Not populated until document build time, as it requires a reference to a DocX document
protected Image,Novacode Image
Résultat Novacode.Image

Scalar public_oe property

Resizing factor when inserting into the document. Maintains aspect ratio
public double Scalar
Résultat double

Stream public_oe property

Image data as memory stream
public MemoryStream Stream
Résultat MemoryStream