Bonjour,
je voudrais lire un JSON en Delphi, son format est le suivant :
Code JSON : 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
{
    "img073.jpg_0.jpg331941": {
        "fileref": "",
        "size": 331941,
        "filename": "img073.jpg_0.jpg",
        "base64_img_data": "",
        "file_attributes": {},
        "regions": {
            "0": {
                "shape_attributes": {
                    "name": "point",
                    "cx": 750,
                    "cy": 155
                },
                "region_attributes": {}
            }
        }
    },
    "img073.jpg_1.jpg289472": {
        "fileref": "",
        "size": 289472,
        "filename": "img073.jpg_1.jpg",
        "base64_img_data": "",
        "file_attributes": {},
        "regions": {
            "0": {
                "shape_attributes": {
                    "name": "point",
                    "cx": 650,
                    "cy": 134
                },
                "region_attributes": {}
            }
        }
    },
    "img073.jpg_2.jpg375774": {
        "fileref": "",
        "size": 375774,
        "filename": "img073.jpg_2.jpg",
        "base64_img_data": "",
        "file_attributes": {},
        "regions": {
            "0": {
                "shape_attributes": {
                    "name": "point",
                    "cx": 181,
                    "cy": 132
                },
                "region_attributes": {}
            }
        }
    },
    "img073.jpg_3.jpg369305": etc.
}
pour les points et :
Code JSON : 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
{
    "feuille003.jpg2163382": {
        "fileref": "",
        "size": 2163382,
        "filename": "feuille003.jpg",
        "base64_img_data": "",
        "file_attributes": {},
        "regions": {
            "0": {
                "shape_attributes": {
                    "name": "polygon",
                    "all_points_x": [
                        434, 523, 567
                    ],
                    "all_points_y": [
                        263, 307, 350, 526, 706, 794, 803, 805, 804, 784, 772, 774
                    ]
                },
                "region_attributes": {}
            },
            "1": {
                "shape_attributes": {
                    "name": "polygon",
                    "all_points_x": [
                        1126, 1172, 1242, 1278, 1292, 1292
                    ],
                    "all_points_y": [
                        72, 89, 139, 179, 108, 72
                    ]
                },
                "region_attributes": {}
            },
            "2": {
                "shape_attributes": {
                    "name": "polygon",
                    "all_points_x": [
                        2211, 2259, 2224
                    ],
                    "all_points_y": [
                        2414, 2416, 2261, 2330, 2414
                    ]
                },
                "region_attributes": {}
            },
            "3": {
                "shape_attributes": {
                    "name": "polygon",
                    "all_points_x": [
                        440, 482, 530, 440
                    ],
                    "all_points_y": [
                        2712, 2721, 2729, 2722, 2712
                    ]
                },
                "region_attributes": {}
            }
        }
    },
    "feuilles016.jpg2052164": {
        "fileref": "",
        "size": 2052164,
        "filename": "feuilles016.jpg",
        "base64_img_data": "",
        "file_attributes": {},
        "regions": {
            "0": {
                "shape_attributes": {
                    "name": "polygon",
                    "all_points_x": [
                        1117, 1140, 1162
                    ],
                    "all_points_y": [
                        1232, 1197
                    ]
                },
                "region_attributes": {}
            },
            "1": {
                "shape_attributes": {
                    "name": "polygon",
                    "all_points_x": [
                        517, 497, 498, 495, 494, 478, 485, 461
                    ],
                    "all_points_y": [
                        465, 470, 590, 800, 826, 876, 965
                    ]
                },
                "region_attributes": {}
            },
            "2": {
                "shape_attributes": {
                    "name": "polygon",
                    "all_points_x": [
                        1789, 1828
                    ],
                    "all_points_y": [
                        101, 115, 132, 157, 237
                    ]
                },
                "region_attributes": {}
            }
        }
    },
    "feuilles017.jpg2233353": {
        "fileref": "",
        "size": 2233353,
        "filename": "feuilles017.jpg",
        "base64_img_data": "",
        "file_attributes": {},
        "regions": {
            "0": {
                "shape_attributes": {
                    "name": "polygon",
                    "all_points_x": [
                        1314, 1171, 1062, 990, 960, 960, 937
                    ]
                }
            }
        }
    }
}
pour les polygones

je souhaiterais récupérer pour chaque image (exemple : "filename":"img073.jpg_0.jpg") ses points ({"name":"point","cx":650,"cy":134}) ou ses polygones ({"name":"polygon","all_points_x":[2211,2259,2224],"all_points_y":[2414,2416,2261,2330,2414]}) je souhaiterais récupérer chaque coordonnée de point ou de polygone.
J'ai déjà un type polygone qui est un TList de Tpoint et les all_points_x sont tous les x des points à la suite et les all_points_y sont tous les y à la suite.
Merci de m'aider car je n'ai jamais parsé de JSON en Delphi et n'y arrive pas, j'ai cherché des tutos sur Internet mais ne comprends pas.
Merci
Bien cordialement