Class GorgonGlyphTextureBrush
A brush used to draw glyphs using a texture.
Inherited Members
Namespace: Gorgon.Graphics.Fonts
Assembly: Gorgon.Graphics.Fonts.dll
Syntax
public class GorgonGlyphTextureBrush : GorgonGlyphBrush, IGorgonCloneable<GorgonGlyphBrush>, IEquatable<GorgonGlyphBrush>
Remarks
This will paint glyphs using the IGorgonImage provided to the constructor.
The texture used by this brush is a IGorgonImage and not a GorgonTexture2D, and must be a 2D image, and have a format of R8G8B8A8_UNorm_SRgb
,
BufferFormat.R8G8B8A8_UNorm
, BufferFormat.B8G8R8A8_UNorm
, or BufferFormat.B8G8R8A8_UNorm_SRgb
.
Constructors
| Edit this page View SourceGorgonGlyphTextureBrush(IGorgonImage)
Initializes a new instance of the GorgonGlyphPathGradientBrush class.
Declaration
public GorgonGlyphTextureBrush(IGorgonImage textureImage)
Parameters
Type | Name | Description |
---|---|---|
IGorgonImage | textureImage | The image to use as a texture. |
Remarks
The image format for the brush must be R8G8B8A8_UNorm, R8G8B8A8_UNorm_SRgb, B8G8R8A8_UNorm, B8G8R8A8_UNorm_SRgb, or one of the compressed formats (e.g. BC3, BC7, etc..) and must be a 2D image.
A copy of the textureImage
is stored in this object instead of a direct reference to the original image.
Exceptions
Type | Condition |
---|---|
ArgumentException | Thrown when the |
See Also
Properties
| Edit this page View SourceBrushType
Property to return the type of brush.
Declaration
public override GlyphBrushType BrushType { get; }
Property Value
Type | Description |
---|---|
GlyphBrushType |
Overrides
See Also
Image
Property to return the image data to apply to the brush.
Declaration
public Span<byte> Image { get; }
Property Value
Type | Description |
---|---|
Span<byte> |
See Also
TextureHeight
Property to return the height of the texture, in pixels.
Declaration
public int TextureHeight { get; }
Property Value
Type | Description |
---|---|
int |
See Also
TextureRegion
Property to set or return the region to use when applying the Image as a texture.
Declaration
public RectangleF TextureRegion { get; set; }
Property Value
Type | Description |
---|---|
RectangleF |
Remarks
This value is in relative texture coordinates.
See Also
TextureWidth
Property to return the width of the texture, in pixels.
Declaration
public int TextureWidth { get; }
Property Value
Type | Description |
---|---|
int |
See Also
WrapMode
Property to set or return the wrapping mode for the gradient fill.
Declaration
public GlyphBrushWrapMode WrapMode { get; set; }
Property Value
Type | Description |
---|---|
GlyphBrushWrapMode |
See Also
Methods
| Edit this page View SourceClone()
Function to clone an object.
Declaration
public override GorgonGlyphBrush Clone()
Returns
Type | Description |
---|---|
GorgonGlyphBrush | The cloned object. |
Overrides
See Also
Equals(GorgonGlyphBrush)
Indicates whether the current object is equal to another object of the same type.
Declaration
public override bool Equals(GorgonGlyphBrush other)
Parameters
Type | Name | Description |
---|---|---|
GorgonGlyphBrush | other | An object to compare with this object. |
Returns
Type | Description |
---|---|
bool |
true
True
true
true (True in Visual Basic) if the current object is equal to the other parameter; otherwise, falseFalsefalsefalse (False in Visual Basic).
|
Overrides
See Also
ToGorgonImage()
Function to convert this brush into a regular image.
Declaration
public IGorgonImage ToGorgonImage()
Returns
Type | Description |
---|---|
IGorgonImage | A new IGorgonImage containing the brush image data. |