Pen::GetAlignment, méthode (gdipluspen.h)
La méthode Pen::GetAlignment obtient l’alignement actuellement défini pour cet objet Pen .
Syntaxe
PenAlignment GetAlignment();
Valeur de retour
Type : PenAlignment
Cette méthode retourne un élément de l’énumération PenAlignment qui indique le paramètre d’alignement actuel de cet objet Pen .
Notes
La valeur par défaut de PenAlignmentCenter est PenAlignmentCenter.
Exemples
L’exemple suivant crée un objet Pen , définit l’alignement, dessine une ligne, puis obtient les paramètres d’alignement du stylet.
VOID Example_GetAlignment(HDC hdc)
{
Graphics graphics(hdc);
// Create a Pen object and set its alignment.
Pen pen(Color(255, 0, 255, 0), 15);
pen.SetAlignment(PenAlignmentCenter);
// Draw a line.
graphics.DrawLine(&pen, 0, 0, 100, 50);
// Obtain information about the Pen object.
PenAlignment penAlignment;
penAlignment = pen.GetAlignment();
if(penAlignment == PenAlignmentCenter)
; // The pixels will be centered on the theoretical line.
else if(penAlignment == PenAlignmentInset)
; // The pixels will lie inside the filled area of the theoretical line.
}
Configuration requise
Client minimal pris en charge | Windows XP, Windows 2000 Professionnel [applications de bureau uniquement] |
Serveur minimal pris en charge | Windows 2000 Server [applications de bureau uniquement] |
Plateforme cible | Windows |
En-tête | gdipluspen.h (inclure Gdiplus.h) |
Bibliothèque | Gdiplus.lib |
DLL | Gdiplus.dll |
Voir aussi
Commentaires
https://aka.ms/ContentUserFeedback.
Bientôt disponible : Tout au long de 2024, nous allons supprimer progressivement GitHub Issues comme mécanisme de commentaires pour le contenu et le remplacer par un nouveau système de commentaires. Pour plus d’informations, consultezEnvoyer et afficher des commentaires pour