从 Goocanvas::Points 获取坐标
我试图从 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
I'm attempting to get the coordinates from an instance of Goocanvas::Points in goocanvasmm. I have this:
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);
}
Which should work. But it outputs this when I try to compile:
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你试过这个吗?
Have you tried this?