Une fois que la méthode a été appelée, elle produit un objet Graphics.
Cette plate-forme est un objet Graphics.
Vous pouvez accéder à l'objet Graphics comme suit
Les formes elles-mêmes sont gérées par un objet Graphics().
The forms are managed by a Graphics object ().
Comme mentionné ci-dessus, avant le dessin, assurez-vous que vous disposez d'un objet Graphics, qui dépend de votre approche de dessin.
As mentioned above, before drawing, make sure you have a Graphics object, which depends on your approach to drawing.
L'argument qui lui est passé doit être un handle de l'objet dont vous voulez utiliser l'objet Graphics.
The argument passed to it must be a handle to the object whose Graphics object you want to access.
Du fait que presque chaque méthode GDI+ requiert un objet Graphics comme contexte dans lequel afficher le résultat, le plus simple est de transmettre ce contexte Graphics comme paramètre à la méthode Draw de l'horloge à partir de l'événement Paint du formulaire.
Because almost every method in GDI+ requires a Graphics object as a context in which to display output, it's simplest to pass that Graphics context as a parameter to the clock's Draw method from the Paint event of the form.
Pour utiliser un objet Shape, on crée tout d'abord un objet ensuite l'objet Graphics() en tant que paramètre pour l'objet Shape().
To use a Shape object, first we have to create a Graphics object (). We then pass the Graphics object() as a parameter of the Shape object().
Comme vous pouvez le voir, la méthode CreateGraphics() renvoie l'objet Graphics de la variable à partir de laquelle vous l'appelez.
As you can see, the CreateGraphics() method returns the Graphics object of the variable you call it from.
Dans notre introduction aux graphiques, nous avions vu plusieurs manières d'obtenir an objet Graphics, soit en appelant la méthode CreateGraphics() d'une classe dérivée de Control ou à partir d'un handle du contrôle.
In our introduction to graphics, we saw various ways of getting a getting a Graphics object, either from the CreateGraphics() method of a Control-derived class or from the handle of the control.
L'argument transmis doit être un pointeur vers l'objet Graphics vous souhaitez accéder.