PointConverter, classe (System.Drawing)

Bibliothèque de classes .NET Framework 
PointConverter, classe 

Convertit un objet Point d'un type de données à un autre. Accédez à cette classe via l'objet TypeDescriptor.

Espace de noms : System.Drawing
Assembly : System.Drawing (dans system.drawing.dll)

SyntaxeSyntaxe


Visual Basic (Déclaration)
Public Class PointConverter
    Inherits TypeConverter


Visual Basic (Utilisation)
Dim instance As PointConverter


C#
public class PointConverter : TypeConverter


C++
public ref class PointConverter : public TypeConverter


J#
public class PointConverter extends TypeConverter


JScript
public class PointConverter extends TypeConverter
ExempleExemple

L'exemple de code suivant illustre l'utilisation de PointConverter et de l'opérateur op_Subtraction. Cet exemple est conçu pour être utilisé avec Windows Forms. Collez ce code dans un formulaire et appelez la méthode ShowPointConverter lors de la gestion de l'événement Paint du formulaire, en passant e comme PaintEventArgs.



Visual Basic
Private Sub ShowPointConverter(ByVal e As PaintEventArgs)

    ' Create the PointConverter.
    Dim converter As System.ComponentModel.TypeConverter = _
        System.ComponentModel.TypeDescriptor.GetConverter(GetType(Point))

    Dim point1 As Point = _
        CType(converter.ConvertFromString("200, 200"), Point)

    ' Use the subtraction operator to get a second point.
    Dim point2 As Point = Point.op_Subtraction(point1, _
        New Size(190, 190))

    ' Draw a line between the two points.
    e.Graphics.DrawLine(Pens.Black, point1, point2)
End Sub


C#
private void ShowPointConverter(PaintEventArgs e)
{

    // Create the PointConverter.
    System.ComponentModel.TypeConverter converter = 
        System.ComponentModel.TypeDescriptor.GetConverter(typeof(Point));

    Point point1 = (Point) converter.ConvertFromString("200, 200");

    // Use the subtraction operator to get a second point.
    Point point2 = point1 - new Size(190, 190);

    // Draw a line between the two points.
    e.Graphics.DrawLine(Pens.Black, point1, point2);
}


C++
void ShowPointConverter( PaintEventArgs^ e )
{
   // Create the PointConverter.
   System::ComponentModel::TypeConverter^ converter = System::ComponentModel::TypeDescriptor::GetConverter( Point::typeid );
   Point point1 =  *dynamic_cast<Point^>(converter->ConvertFromString( "200, 200" ));

   // Use the subtraction operator to get a second point.
   Point point2 = point1 - System::Drawing::Size( 190, 190 );

   // Draw a line between the two points.
   e->Graphics->DrawLine( Pens::Black, point1, point2 );
}


J#
private void ShowPointConverter(PaintEventArgs e)
{
    // Create the PointConverter.
    PointConverter converter = new PointConverter();
    Point point1 = (Point)converter.ConvertFromString("200, 200");

    // Use the subtraction operator to get a second point.
    Point point2 = Point.op_Subtraction(point1 , new Size(190, 190));

    // Draw a line between the two points.
    e.get_Graphics().DrawLine(Pens.get_Black(), point1, point2);
} //ShowPointConverter
Hiérarchie d'héritageHiérarchie d'héritage
System.Object
   System.ComponentModel.TypeConverter
    System.Drawing.PointConverter
Sécurité des threadsSécurité des threads
Les membres statiques publics (Shared en Visual Basic) de ce type sont thread-safe. Il n'est pas garanti que les membres d'instance soient thread-safe.
Plates-formesPlates-formes

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Édition Media Center, Windows XP Professionnel Édition x64, Windows XP SP2, Windows XP Starter Edition

Le .NET Framework ne prend pas en charge toutes les versions de chaque plate-forme. Pour obtenir la liste des versions prises en charge, consultez Configuration requise.

Informations de versionInformations de version

.NET Framework

Prise en charge dans : 2.0, 1.1, 1.0
Voir aussiVoir aussi

Ces informations proviennent du site de http://msdn2.microsoft.com
Source de cette page : http://msdn2.microsoft.com/fr-fr/library/system.drawing.pointconverter.aspx

Réseaux sociaux

Vous pouvez modifier vos préférences dans votre profil pour ne plus afficher les interactions avec les réseaux sociaux sur ces pages.

 

Nuage de mots clés

8 mots clés dont 0 définis manuellement (plus d'information...).

Avertissement

Cette page ne possède pas encore de mots clés manuels, ceci est donc un exemple automatique (les niveaux de pertinence sont fictifs, mais les liens sont valables). Pour tester le nuage avec une page qui contient des mots définis manuellement, vous pouvez cliquer ici.

Vous pouvez modifier vos préférences dans votre profil pour ne plus afficher le nuage de mots clés.

 

Astuce pour imprimer les couleurs des cellules de tableaux : http://www.gaudry.be/ast-rf-450.html
Aucun commentaire pour cette page

© Ce document issu de l′infobrol est enregistré sous le certificat Cyber PrInterDeposit Digital Numbertection. Enregistrement IDDN n° 5329-6113
Document créé le 30/10/06 02:16, dernière modification le Vendredi 17 Juin 2011, 12:11
Source du document imprimé : http://www.gaudry.be/dotnet-rf-system.drawing.pointconverter.html Document affiché 3 fois ce mois de Mai.
St.Gaudry©07.01.02
Outils (masquer)
||
Recherche (afficher)
Recherche :

Utilisateur (masquer)
Apparence (afficher)
Stats (afficher)
15832 documents
452 astuces.
549 niouzes.
3099 definitions.
447 membres.
8115 messages.

Document genere en :
0,69 seconde

Mises à jour :
Mises à jour du site
Citation (masquer)
Le rire, comme les essuie-glaces, permet d'avancer même s'il n'arrête pas la pluie.

Gérard Jugnot
 
l'infobrol
Nous sommes le Jeudi 31 Mai 2012, 23:16, toutes les heures sont au format GMT+1.00 Heure, heure d'été (+1)