Salut tout le monde voila voulant me remettre au C++ j'ai donc commencer par re-adapté mes anciens code fais sous d'autre langage. Ayant utiliser GDI+ dans l'un d'eu je souhaiterais faire la même chose. C'est à dire lire des coordonné et ensuite faire un graphique avec.

Le problème c'est que je rencontre un petit problème avec les PointF ce qui me donne un graphique totalement illisible ^^

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
    int nbPolygons; //var for count number of polygons
    int nbPoints; //Var for count number of point into a polygon
    ifstream Reader; //stream for read Reader
    Reader.open((char*)ReaderFile.c_str(), ios::in | ios::binary); //open Reader file
 
    if(!Reader)//if the file can't be open
    {
        Log << "ERROR\n";
    }
 
    Reader.read((char *) &nbPolygons,4);//we read 4bit(int) corresponding to the nb of polygons
    Log << "Nb poly = " <<nbPolygons << "\n";
 
    for(int i = 1; i <= nbPolygons; i++)//for each polygon...
    {
        int x;
        int y;
        PointF tmpPoint[nbPolygons];
 
        Reader.read((char *) &nbPoints,4);//we read 4bit(int) corresponding to the nb of points into a polygon
 
        for (int j = 1; j <= nbPoints; j++)// for each point
        {
             Reader.read((char *) &x,4);
             Reader.read((char *) &y,4);
             Log << "Poly = " << i <<"/"<< nbPolygons << " Nb points = " << j <<"/"<< nbPoints <<" X = " <<(float)x << " Y = "<< (float)y <<" \n";
             tmpPoint[j] = PointF (x,y);
        }
        PointF* pPoints = tmpPoint;
        graphics.DrawPolygon(&blackPen, pPoints,2);
    }
    Log << "Fin";
    Log.close();
    Reader.close();
Ce qui me donne ceci ... :/

http://img4.hostingpics.net/pics/451847rendu.jpg