GlyphRunDrawing.ForegroundBrush Propriedade

Definição

Obtém ou define o pincel de primeiro plano do GlyphRunDrawing.

public:
 property System::Windows::Media::Brush ^ ForegroundBrush { System::Windows::Media::Brush ^ get(); void set(System::Windows::Media::Brush ^ value); };
public System.Windows.Media.Brush ForegroundBrush { get; set; }
member this.ForegroundBrush : System.Windows.Media.Brush with get, set
Public Property ForegroundBrush As Brush

Valor da propriedade

Brush

O pincel que pinta o GlyphRun. O valor padrão é null.

Exemplos

O exemplo a seguir usa um GlyphRunDrawing para desenhar o texto "Olá, Mundo".

GlyphRun theGlyphRun = new GlyphRun(
    new GlyphTypeface(new Uri(@"C:\WINDOWS\Fonts\TIMES.TTF")),
    0,
    false,
    13.333333333333334,
    new ushort[]{43, 72, 79, 79, 82, 3, 58, 82, 85, 79, 71},
    new Point(0, 12.29),
    new double[]{
        9.62666666666667, 7.41333333333333, 2.96, 
        2.96, 7.41333333333333, 3.70666666666667, 
        12.5866666666667, 7.41333333333333, 
        4.44, 2.96, 7.41333333333333},
    null,
    null,
    null,
    null,
    null,
    null

    );

GlyphRunDrawing gDrawing = new GlyphRunDrawing(Brushes.Black, theGlyphRun);
<GlyphRunDrawing ForegroundBrush="Black">
  <GlyphRunDrawing.GlyphRun>
    <GlyphRun 
      CaretStops="{x:Null}" 
      ClusterMap="{x:Null}" 
      IsSideways="False" 
      GlyphOffsets="{x:Null}" 
      GlyphIndices="43 72 79 79 82 3 58 82 85 79 71" 
      BaselineOrigin="0,12.29"  
      FontRenderingEmSize="13.333333333333334" 
      DeviceFontName="{x:Null}" 
      AdvanceWidths="9.62666666666667 7.41333333333333 2.96 2.96 7.41333333333333 3.70666666666667 12.5866666666667 7.41333333333333 4.44 2.96 7.41333333333333" 
      BidiLevel="0">
      <GlyphRun.GlyphTypeface>
        <GlyphTypeface FontUri="C:\WINDOWS\Fonts\TIMES.TTF" />
      </GlyphRun.GlyphTypeface>
    </GlyphRun>
  </GlyphRunDrawing.GlyphRun>
</GlyphRunDrawing>

Um GlyphRun é um objeto de baixo nível destinado a uso com cenários de impressão e apresentação de documento de formato fixo. Uma maneira mais simples de desenhar texto para a tela é usar um Label ou um TextBlock. Para obter mais informações sobre GlyphRun, consulte a introdução ao objeto GlyphRun e à visão geral do elemento Glyphs .

Comentários

Informações da propriedade de dependência

Campo Identificador ForegroundBrushProperty
Propriedades de metadados definidas como true Nenhum

Aplica-se a