|
这个代码太多了
而且,我也不知道在开发板上是哪里出的问题呀
下面是我读取数据并显示的一段代码:
Map_Layer myshpLayer("../data/line.shp");
myshpLayer.GetLayerItems();
for (int i = 0;i<myshpLayer.m_polyLines.size();i++)
{
agg::trans_affine mtx;
mtx.scale(1,1);
mtx.translate(170.0,150.0);
typedef agg::conv_transform<MyPolyline> ell_ct_type;
ell_ct_type ctell(myshpLayer.m_polyLines.at(i), mtx); // 矩阵变换
typedef agg::conv_contour<ell_ct_type> type_line_cc;
type_line_cc line_ccc(ctell);
typedef agg::conv_stroke<type_line_cc> type_line_cs;
type_line_cs line_css(line_ccc);
ras.add_path(line_css);
agg::render_scanlines_aa_solid(
ras,sl,renb,agg::rgba8(255,100,230));
}
////////////////////////////////////////
QImage image((unsigned char*)rbuf.buf(), frame_width, frame_height, QImage::Format_RGB888);
SetUI(this);
scene.addPixmap(QPixmap::fromImage(image));
graphicsView->setScene(&scene);
graphicsView->show(); |
|