This project has moved and is read-only. For the latest updates, please go here.

Drawing with GDI+ on a layer

May 4, 2015 at 11:25 AM

This is my first post,

I need to animate elements in real time (polygons, text, icons) on a basemap.
The basemap can be a shapefile or osm tiles or an bitmap.

Question :
Is it possible to use GDI+ to draw on a layer ? How ?
Is there a better solution ?
May 4, 2015 at 1:47 PM
You can use the ILayer.Render function to draw with gdi+.
You can use Map.VariableLayers collection to update view frequently. This is not suitable for a large amount of features!
May 4, 2015 at 1:58 PM
Thank you,
I need an update at 1Hz ... I will try this.
May 4, 2015 at 5:59 PM
Do I have to use a VectorLayer ? Or do I have to create my own class ?

With a VectorLayer, how to initialize the DataSource ?
May 4, 2015 at 9:34 PM
That depends. To give an answer, you need to provide some additional information like, where does your data come from, what does it look like etc.
May 5, 2015 at 10:56 AM
The elements are polygons, lines, bitmaps, text.

Each element is described like this :
class cElm
Color mColor;
eType mType;
Font mFont; 
Rectangle mRectangle;
Bitmap mBmp;

The state of each element is updated periodically with a TCP communication (no database).
May 6, 2015 at 9:46 AM
So if you are getting objects from the System.Drawing namespace, I'd avoid converting them to GeoAPI.Geometries.
So skip the provider step and do everything within ILayer.

You cannot use VectorLayer then.
May 6, 2015 at 5:35 PM
Thanks FObermaier

remains a problem with the pan and zoom
I hope to solve it