Share via


Método StringFormat::GenericTypographic (gdiplusstringformat.h)

El método StringFormat::GenericTypographic crea un objeto StringFormat genérico tipográfico.

Sintaxis

const StringFormat * GenericTypographic();

Valor devuelto

Tipo: StringFormat*

Este método devuelve un puntero al nuevo objeto StringFormat .

Comentarios

Un objeto StringFormat genérico tipográfico tiene las siguientes características:

  • Se establecen marcas de formato de cadena StringFormatFlagsLineLimit, StringFormatFlagsNoClip y StringFormatFlagsNoFitBlackBox.
  • La alineación de caracteres y la alineación de líneas se establecen en StringAlignmentNear.
  • El identificador de idioma se establece en idioma neutro, lo que significa que se usa el idioma actual asociado al subproceso que realiza la llamada.
  • La sustitución de dígitos de cadena se establece en StringDigitSubstituteUser.
  • El prefijo de clave activa se establece en HotkeyPrefixNone.
  • El número de tabulaciones se establece en cero.
  • El recorte de cadenas se establece en StringTrimmingNone.

Ejemplos

En el ejemplo siguiente se crea un objeto StringFormat genérico tipográfico y, a continuación, se usa para dibujar una cadena con formato. El código también dibuja el rectángulo de diseño de la cadena.

VOID Example_GenericTypographic(HDC hdc)
{
   Graphics graphics(hdc);
   SolidBrush  solidBrush(Color(255, 255, 0, 0)); 
   FontFamily  fontFamily(L"Times New Roman");
   Font        font(&fontFamily, 12, FontStyleRegular, UnitPoint);
   
   // Create a generic typographic StringFormat object.
   const StringFormat* pStringFormat = StringFormat::GenericTypographic();
   // Use the generic typographic StringFormat object 
   // in a call to DrawString.
  graphics.DrawString(
      L"Formatted by a generic typographic StringFormat object", 
      54,  // string length
      &font, 
      RectF(30, 30, 100, 120), 
      pStringFormat, 
      &solidBrush);
   // Draw the rectangle that encloses the text.
   Pen pen(Color(255, 255, 0, 0));
   graphics.DrawRectangle(&pen, 30, 30, 100, 120);
}

Requisitos

Requisito Value
Cliente mínimo compatible Windows XP, Windows 2000 Professional [solo aplicaciones de escritorio]
Servidor mínimo compatible Windows 2000 Server [solo aplicaciones de escritorio]
Plataforma de destino Windows
Encabezado gdiplusstringformat.h (include Gdiplus.h)
Library Gdiplus.lib
Archivo DLL Gdiplus.dll

Consulte también

Fuente

HotkeyPrefix

LOGFONT

RectF

StringAlignment

StringDigitSubstitute

StringFormat

StringFormatFlags

StringTrimming