Class Target
An output connection.
Inheritance
Implements
Inherited Members
Namespace: NetVips
Assembly: NetVips.dll
Syntax
public class Target : Connection, IDisposable
Properties
Blob
Get the memory object held by the target when using NewToMemory().
Declaration
public byte[] Blob { get; }
Property Value
Type | Description |
---|---|
byte[] |
Methods
NewToDescriptor(int)
Make a new target to write to a file descriptor (a small integer).
Declaration
public static Target NewToDescriptor(int descriptor)
Parameters
Type | Name | Description |
---|---|---|
int | descriptor | Write to this file descriptor. |
Returns
Type | Description |
---|---|
Target | A new Target. |
Remarks
Make a new target that is attached to the descriptor. For example:
using var target = Target.NewToDescriptor(1);
Makes a descriptor attached to stdout.
You can pass this target to (for example) WriteToTarget(Target, string, VOption).
Exceptions
Type | Condition |
---|---|
VipsException | If unable to create a new Target from |
NewToFile(string)
Make a new target to write to a file.
Declaration
public static Target NewToFile(string filename)
Parameters
Type | Name | Description |
---|---|---|
string | filename | Write to this this file. |
Returns
Type | Description |
---|---|
Target | A new Target. |
Remarks
Make a new target that will write to the named file. For example:
using var target = Target.NewToFile("myfile.jpg");
You can pass this target to (for example) WriteToTarget(Target, string, VOption).
Exceptions
Type | Condition |
---|---|
VipsException | If unable to create a new Target from |
NewToMemory()
Make a new target to write to an area of memory.
Declaration
public static Target NewToMemory()
Returns
Type | Description |
---|---|
Target | A new Target. |
Remarks
Make a new target that will write to memory. For example:
using var target = Target.NewToMemory();
You can pass this target to (for example) WriteToTarget(Target, string, VOption).
After writing to the target, fetch the bytes from the target object with:
var bytes = target.Blob;
Exceptions
Type | Condition |
---|---|
VipsException | If unable to create a new Target. |