Class Target
An output connection.
Inheritance
Implements
Inherited Members
Namespace: NetVips
Assembly: NetVips.dll
Syntax
public class Target : Connection, IDisposable
Methods
| Improve this Doc View SourceNewToDescriptor(Int32)
Make a new target to write to a file descriptor (a small integer).
Declaration
public static Target NewToDescriptor(int descriptor)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | 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:
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 |
---|---|---|
System.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:
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:
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.Get("blob");
Exceptions
Type | Condition |
---|---|
VipsException | If unable to create a new Target. |