[Qgis-developer] Re: Draw a single point

Germán Carrillo carrillo.german at gmail.com
Mon Dec 14 10:21:35 EST 2009


After a short talk with Sergio, we found that what he wants is to set the
points size in map units, just like QGIS does it.

So he is looking at the setPointSizeUnits method from QgsSymbol class. This
way he can't use QgsVertexMarker (I guess), so he should use a temporal
layer.

Germán

2009/12/14 Martin Dobias <wonder.sk at gmail.com>

> 2009/12/11 sergio cavalcante <sergio.cavalcante at gmail.com>:
> > Germán! It workerd great!
> > As I'm using C++ with Qt, the code to draw just a white point is here:
> >
> >  QgsVertexMarker *marker = new QgsVertexMarker(m_qgsImage);
> >
> >  marker->setCenter( QgsPoint( -51.235, -16.9316 ) );
> >  //marker->setCenter( QgsPoint( -51.235, -16.9316 ) );
> >  marker->setIconType( 3 );
> >  marker->setIconSize( 10 );
> >  marker->setColor( QColor( 255,255,255,255 ) );
> >  marker->setPenWidth ( 1 );
> >
> > I was very happy...Until I zoomed the area. As a vector, obviously,
> > when zoomed, it remained as a small point. And, as I need to draw a
> > lot of points to draw a larger image composed by them, I needed that
> > this zoom to escale the point like a raster file. Is there a way to
> > plot the point onto the rasterfile?
>
> Hi Sergio,
>
> what are you actually trying to do? Draw an image on the canvas at
> some specified place? You might want to create a class derived from
> QgsMapCanvasItem that would do the rendering in a way you want it to
> be.
>
> Martin
>
-- 
-----------
  |\__
(:>__)(
  |/

Soluciones Geoinformáticas Libres
http://geotux.tuxfamily.org/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/qgis-developer/attachments/20091214/80b7eb28/attachment.html


More information about the Qgis-developer mailing list