gpt4 book ai didi

c++ - 从 Goocanvas::Points 获取坐标

转载 作者:太空宇宙 更新时间:2023-11-04 12:24:30 25 4
gpt4 key购买 nike

我正在尝试从 goocanvasmm 中的 Goocanvas::Points 实例获取坐标。我有这个:

double x = 0, y = 0;
int i;
Goocanvas::Points points;
Glib::RefPtr<Goocanvas::Item> root = canvaswidget.get_root_item();
Glib::RefPtr<Goocanvas::Polyline> line = Goocanvas::Polyline::create(100, 100, 110, 120);
root->add_child(line);
points = line->property_points().get_value();
for (i = 0; i < 2; i++){
points.get_coordinate(i, &x, &y);
printf("%f03, %f03", x, y);
}

哪个应该有效。但是当我尝试编译时它会输出:

main.cpp: In function ‘int main(int, char**)’:
main.cpp:21: error: no matching function for call to ‘Goocanvas::Points::get_coordinate(int&, double*, double*)’
/usr/include/goocanvasmm-0.1/goocanvasmm/points.h:82: note: candidates are: void Goocanvas::Points::get_coordinate(int, double&, double&) const
make: *** [all] Error 1

最佳答案

你试过吗?

points.get_coordinate(i, x, y);

关于c++ - 从 Goocanvas::Points 获取坐标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3215646/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com