Graphics ::TranslateClip(REAL,REAL) méthode (gdiplusgraphics.h)

La méthode Graphics ::TranslateClip traduit la zone de découpage de cet objet Graphics .

Syntaxe

Status TranslateClip(
  REAL dx,
  REAL dy
);

Paramètres

dx

Nombre réel qui spécifie le composant horizontal de la traduction.

dy

Nombre réel qui spécifie le composant vertical de la traduction.

Valeur retournée

Si la méthode réussit, elle retourne Ok, qui est un élément de l’énumération Status .

Si la méthode échoue, elle retourne l’un des autres éléments de l’énumération Status .

Notes

Exemples

L’exemple suivant mesure la taille d’une chaîne, puis dessine un rectangle qui représente cette taille.

VOID Example_TranslateClipReal(HDC hdc)
{
   Graphics graphics(hdc);

   // Set the clipping region.
   graphics.SetClip(RectF(0.0f, 0.0f, 100.0f, 50.0f));

   // Translate the clipping region.
   graphics.TranslateClip(40.0f, 30.0f);

   // Fill an ellipse that is clipped by the translated clipping region.
   SolidBrush brush(Color(255, 255, 0, 0));
   graphics.FillEllipse(&brush, 20, 40, 100, 80);

   // Draw the outline of the clipping region (rectangle).
   Pen pen(Color(255, 0, 0, 0), 2.0f);
   graphics.DrawRectangle(&pen, 40, 30, 100, 50);
}

Configuration requise

Condition requise Valeur
En-tête gdiplusgraphics.h

Voir aussi

Découpage

Découpage avec une région

Graphismes

Graphics ::GetClip

Graphics ::IsClipEmpty

Méthodes IntersectClip

SetClip, méthodes