Color legend plain property dependency property method
The value of Image.Source: a wrapper around a texture that you rarely write yourself, since a Texture2D or a content path converts to it. It doesn’t own the texture. Two SourceData are equal when they wrap the same texture instance.
A class. The images page shows it in context.
Names are colored by what they are: a property, a method or an event; values and fields keep the plain color.
Properties
Height 🠆
int · Read-only. The texture’s height in pixels, 0 without a texture.
IsEmpty 🠆
bool · Read-only. Whether there is nothing to draw: no texture, or a width or height of 0.
Width 🠆
int · Read-only. The texture’s width in pixels, 0 without a texture.
Methods
SourceData() 🠆
SourceData(Texture2D texture) · Wraps the texture.
| Parameter | Type | Description |
|---|---|---|
texture |
Texture2D |
The texture to wrap. |
implicit operator SourceData(Texture2D texture) · Lets you assign a texture where a SourceData is expected.
| Parameter | Type | Description |
|---|---|---|
texture |
Texture2D |
The texture to wrap. |
implicit operator SourceData(string path) · Loads the content path as a Texture2D through the UI’s ContentManager and wraps it.
| Parameter | Type | Description |
|---|---|---|
path |
string |
A content path, loaded as a Texture2D through the UI’s ContentManager. |
!=() 🠆
operator != · Compare a SourceData with another SourceData, a Texture2D or a content path, in either order, by texture instance. Comparing with a path loads that path through the ContentManager.
==() 🠆
operator == · Compare a SourceData with another SourceData, a Texture2D or a content path, in either order, by texture instance. Comparing with a path loads that path through the ContentManager.
Equals() 🠆
Equals(object obj) · Whether obj is a SourceData wrapping the same texture instance.
| Parameter | Type | Description |
|---|---|---|
obj |
object |
The object to compare with. |
GetHashCode() 🠆
GetHashCode() · The hash code of the wrapped texture, 0 without one.
Texture2D() 🠆
implicit operator Texture2D(SourceData data) · Gives back the wrapped texture (null when it wraps none).
| Parameter | Type | Description |
|---|---|---|
data |
SourceData |
The source data whose texture is returned. |