Fonctions de texte
Windows GDI+ expose une API plate qui se compose d’environ 600 fonctions, qui sont implémentées dans Gdiplus.dll et déclarées dans Gdiplusflat. h. les fonctions de l’API plate GDI+ sont encapsulées par une collection d’environ 40 classes C++. Il est recommandé de ne pas appeler directement les fonctions dans l’API plate. chaque fois que vous effectuez des appels à GDI+, vous devez le faire en appelant les méthodes et les fonctions fournies par les wrappers C++. Les services de support technique Microsoft ne fournissent pas de prise en charge du code qui appelle l’API plate directement. pour plus d’informations sur l’utilisation de ces méthodes wrapper, consultez GDI+ l’API plate. Les fonctions d’API plates suivantes sont encapsulées par la classe de texte Graphics C++.
Fonctions de texte et méthodes Wrapper correspondantes
| Fonction plate | Méthode Wrapper | Remarques |
|---|---|---|
| GpStatus WINGDIPAPI GdipDrawString (GpGraphics * Graphics, GDIPCONST WCHAR * String, int length, GDIPCONST GpFont * police, GDIPCONST RECTF LayoutRect * , GDIPCONST GpStringFormat * stringFormat, GDIPCONST GpBrush * Brush) |
Graphique d’État ::D rawString (dans la chaîne de const WCHAR * , dans la longueur de int, dans la police de police const * , dans const RectF &LAYOUTRECT, dans const StringFormat * StringFormat, dans le pinceau de pinceau const * ) |
Dessine une chaîne basée sur une police, un rectangle de disposition et un format. |
| GpStatus WINGDIPAPI GdipMeasureString (GpGraphics * Graphics, GDIPCONST WCHAR * String, int length, GDIPCONST GpFont * police, GDIPCONST RECTF LayoutRect * , GDIPCONST GpStringFormat * STRINGFORMAT, RectF * boundingBox, int * codepointsFitted, int * linesFilled) |
Graphics :: MeasureString (dans la chaîne const WCHAR * , dans la longueur int, dans la * police const, dans const RectF &LAYOUTRECT, dans const StringFormat * StringFormat, sortie RECTF * boundingBox, out int * CODEPOINTSFITTED = 0, out int * linesFilled = 0) const |
Mesure l’étendue de la chaîne dans la police, le format et le rectangle de disposition spécifiés. |
| GpStatus WINGDIPAPI GdipMeasureCharacterRanges (GpGraphics * Graphics, GDIPCONST WCHAR * String, int length, GDIPCONST GpFont * police, GDIPCONST RectF &LayoutRect, GDIPCONST GPSTRINGFORMAT * stringFormat, int regionCount, GpRegion * * regions) |
Graphics :: MeasureCharacterRanges (dans la chaîne const WCHAR * , dans la longueur int, dans la * police const, dans const RectF &LAYOUTRECT, dans const StringFormat * STRINGFORMAT, dans int REGIONCOUNT, * régions hors région) const |
Obtient un ensemble de régions qui délimitent chacune une plage de positions de caractères dans une chaîne. |
| GpStatus WINGDIPAPI GdipDrawDriverString (GpGraphics * Graphics, GDIPCONST UINT16 * Text, int length, GDIPCONST GpFont * police, GDIPCONST GPBRUSH * Brush, GDIPCONST PointF * positions, int flags, GDIPCONST GpMatrix * Matrix) |
Graphiques d’État ::D rawDriverString (dans const UINT16 * Text, en longueur int, dans la police const, dans le pinceau * const pinceau * , dans les positions const PointF * , dans les indicateurs int, dans la matrice de matrice const * ) |
Dessine des caractères aux positions spécifiées. La méthode donne au client un contrôle total sur l’apparence du texte. La méthode suppose que le client a déjà configuré le format et la disposition à appliquer. |
| GpStatus WINGDIPAPI GdipMeasureDriverString (GpGraphics * Graphics, GDIPCONST UINT16 * Text, int length, GDIPCONST GpFont * police, GDIPCONST POINTF * positions, int flags, GDIPCONST GpMatrix * Matrix, RectF * boundingBox) |
Graphics :: MeasureDriverString (dans const UINT16 * Text, dans la longueur int, dans la police const * , dans les positions const POINTF * , dans les indicateurs int, dans la matrice de matrice const * , sortie RectF * boundingBox) const |
Mesure le cadre englobant pour les caractères spécifiés et leurs positions correspondantes. |