Gorgon
Show / Hide Table of Contents

Class GorgonGlyphTextureBrush

A brush used to draw glyphs using a texture.

Inheritance
object
GorgonGlyphBrush
GorgonGlyphTextureBrush
Implements
IGorgonCloneable<GorgonGlyphBrush>
IEquatable<GorgonGlyphBrush>
Inherited Members
GorgonGlyphBrush.GetHashCode()
GorgonGlyphBrush.Equals(object)
object.ToString()
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetType()
object.MemberwiseClone()
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 Source

GorgonGlyphTextureBrush(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 textureImage parameter uses an unsupported format or is not a 2D image.

See Also
GorgonGlyphSolidBrush
GorgonGlyphHatchBrush
GorgonGlyphLinearGradientBrush
GorgonGlyphPathGradientBrush

Properties

| Edit this page View Source

BrushType

Property to return the type of brush.

Declaration
public override GlyphBrushType BrushType { get; }
Property Value
Type Description
GlyphBrushType
Overrides
GorgonGlyphBrush.BrushType
See Also
GorgonGlyphSolidBrush
GorgonGlyphHatchBrush
GorgonGlyphLinearGradientBrush
GorgonGlyphPathGradientBrush
| Edit this page View Source

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
GorgonGlyphSolidBrush
GorgonGlyphHatchBrush
GorgonGlyphLinearGradientBrush
GorgonGlyphPathGradientBrush
| Edit this page View Source

TextureHeight

Property to return the height of the texture, in pixels.

Declaration
public int TextureHeight { get; }
Property Value
Type Description
int
See Also
GorgonGlyphSolidBrush
GorgonGlyphHatchBrush
GorgonGlyphLinearGradientBrush
GorgonGlyphPathGradientBrush
| Edit this page View Source

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
GorgonGlyphSolidBrush
GorgonGlyphHatchBrush
GorgonGlyphLinearGradientBrush
GorgonGlyphPathGradientBrush
| Edit this page View Source

TextureWidth

Property to return the width of the texture, in pixels.

Declaration
public int TextureWidth { get; }
Property Value
Type Description
int
See Also
GorgonGlyphSolidBrush
GorgonGlyphHatchBrush
GorgonGlyphLinearGradientBrush
GorgonGlyphPathGradientBrush
| Edit this page View Source

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
GorgonGlyphSolidBrush
GorgonGlyphHatchBrush
GorgonGlyphLinearGradientBrush
GorgonGlyphPathGradientBrush

Methods

| Edit this page View Source

Clone()

Function to clone an object.

Declaration
public override GorgonGlyphBrush Clone()
Returns
Type Description
GorgonGlyphBrush

The cloned object.

Overrides
GorgonGlyphBrush.Clone()
See Also
GorgonGlyphSolidBrush
GorgonGlyphHatchBrush
GorgonGlyphLinearGradientBrush
GorgonGlyphPathGradientBrush
| Edit this page View Source

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
GorgonGlyphBrush.Equals(GorgonGlyphBrush)
See Also
GorgonGlyphSolidBrush
GorgonGlyphHatchBrush
GorgonGlyphLinearGradientBrush
GorgonGlyphPathGradientBrush
| Edit this page View Source

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.

See Also
GorgonGlyphSolidBrush
GorgonGlyphHatchBrush
GorgonGlyphLinearGradientBrush
GorgonGlyphPathGradientBrush

Implements

IGorgonCloneable<T>
IEquatable<T>

Extension Methods

GorgonDebugExtensions.ValidateObject<T>(T, string)
GorgonNullExtensions.AsNullable<T>(object)
GorgonNullExtensions.IfNull<T>(object, T)
GorgonNullExtensions.IsNull(object)

See Also

GorgonGlyphSolidBrush
GorgonGlyphHatchBrush
GorgonGlyphLinearGradientBrush
GorgonGlyphPathGradientBrush
  • Edit this page
  • View Source
In this article
Back to top Copyright 2023 - Licensed under the MIT license by Michael Winsor (Tape_Worm).
Send comments on this topic to the author