MapWindow Developer Team : MapWindow Discussion Forum
Results 1 - 30 of 484
8 months ago
Sergei
Fernando,
it seems to be easy to fix.
1. Add a category with black color before the cycle.
dim ct as ShapefileCategory = Shapefile.Categories.Add("Black")
ct.FillColor = Color.Black
2. In the cycle rather than setting color, set the index of category for the shape
Shapefile.ShapeCategory(ShapeIndex, 0) ' 0 - the index of black category
I guess it's possible to get r
Forum: MapWindow 4 - Plugins
Forum: MapWindow 4 - Plugins
1 year ago
Sergei
It's the expected behavior, the set part of the property was turned off, while get one displays result of automatic selection.
As we need to force smoothing in some way, I've just made changes to allow override automatically chosen mode with vdmGdiPlus. So it will be possible to set smoothing by:
DefaultDrawingOptions.DrawingMode = vdmGdiPlus;
Other values vdmGdi, vdmGdiMixed of property w
Forum: MapWindow 4 - ActiveX Control Programming
Forum: MapWindow 4 - ActiveX Control Programming
1 year ago
Sergei
There is no easy way to do it I suppose. SelectionDrawingOptions property completely overrides both the DefaultDrawingOptions and categories indeed.
It's also possible to set Shapefile.SelectionAppearance to saSelectionColor then Shapefile.SelectionColor, Shapefile.SelectionTransparency properties will be used to draw semi-transparent selection on the top of the existing symbology. But for pol
Forum: MapWindow 4 - ActiveX Control Programming
Forum: MapWindow 4 - ActiveX Control Programming
1 year ago
Sergei
Try to set ShapeDrawingOptions.LineTransparency somewhat smaller then 255. It will force GDI+ drawing and the smoothing of the lines I suppose.
--
Sergei
Forum: MapWindow 4 - ActiveX Control Programming
Forum: MapWindow 4 - ActiveX Control Programming
1 year ago
Sergei
To build color scheme in version 4.8, shapefile categories should be used. There are few shapes in your case, so it will be quite efficient to define a category for each unique color. A code like this can be used:
// index of category by uint representation of color
Dictionary<uint, int> categoryByColor = new Dictionary<uint, int>();
Forum: MapWindow 4 - Plugins
Forum: MapWindow 4 - Plugins
1 year ago
Sergei
Rolf,
there is a possibility to create a custom lines using LinePattern class. There is a GUI to build such lines in the MapWindow (click on the preview icon for the polyline layer in the legend). I attach a screenshot with some sample patterns.
Hope it'll help,
Sergei
Forum: MapWindow 4 - ActiveX Control Programming
Forum: MapWindow 4 - ActiveX Control Programming
1 year ago
Sergei
Hi,
I did some work on adding support for storing MapWinGIS shapefiles in databases.
ShapefileDataClient class is implemented in MapWindow.Controls. I added suport
of several providers, which should implement IDataProvider interface and
be passed to ShapefileDataClient Constructor.
Shape data stored as array of bytes (BLOB) in the same format it's done inside shapefile.
Two methods ar
Forum: MapWindow Developer Team
Forum: MapWindow Developer Team
1 year ago
Sergei
Hi Poom,
yes it's possible. Let me know what functions are needed.
Regards,
Sergei
Forum: MapWindow Developer Team
Forum: MapWindow Developer Team
1 year ago
Sergei
I spotted the following behavior testing MapWinGIS.GeoProjection class. It's just a wrapper around OGRSpatialReference class, so it's GDAL behavior infact. Test code:
private void button8_Click(object sender, EventArgs e)
{
MapWinGIS.GeoProjection proj = new GeoProjection();
proj.ImportFromEPSG(4326);
System.Diagnostics.Debug.Print(proj.E
Forum: MapWindow Developer Team
Forum: MapWindow Developer Team
1 year ago
Sergei
Hi everyone!
Some work was done and a toolbox was added to MW4 GUI to substitute GIS tools menu. It's located in the same window with legend, in separate tab.
It's possible to add custom tools in the toolbox as well. Here is code sample which demonstrates the basics of interaction with toolbox.
I'll attach screenshots soon.
/// <summary>
/// Fills toolbox with
Forum: MapWindow Developer Team
Forum: MapWindow Developer Team
1 year ago
Sergei
1. There is no sector in default point symbols indeed. So the only way to do it is to set appropriate icon:
MapWinGIS.Image img = new MapWinGIS.Image();
img.Open(FileWithSector, ...);
ShapeDrawingOptions.PointType = ptSymbolPicture;
ShapeDrawingOptions.Picture = img;
In fact it's not such a big deal to add the new symbol. Consider the code here:
If you can provide code for your new sym
Forum: MapWindow 4 - ActiveX Control Programming
Forum: MapWindow 4 - ActiveX Control Programming
1 year ago
Sergei
Jeff, you should use something like this:
int categoryIndex = Shapefile.get_ShapeCategory(ShapeIndex);
if (categoryIndex == -1)
return sf.DefaultDrawingOptions.FillColor;
else
return sf.Categories.get_Item(categoryIndex).FillColor;
Hope it'll help,
Sergei
Forum: MapWindow 4 - ActiveX Control Programming
Forum: MapWindow 4 - ActiveX Control Programming
1 year ago
Sergei
The first thing is simple: you should call Categories.ApplyExpression(i) after adding new shapes.
But I can't give a quick answer regarding transparency issue, I need to test the code.
Hope it'll help,
Sergei
Forum: MapWindow 4 - ActiveX Control Programming
Forum: MapWindow 4 - ActiveX Control Programming
1 year ago
Sergei
I've added the new method ShapefileCategories.AddRange. Example is here:
Forum: MapWindow 4 - Plugins
Forum: MapWindow 4 - Plugins
1 year ago
Sergei
Dan,
Chris has provided an approach here: , but it's quite a difficult one. I'd rather add an overloaded method: ShapefileCategories.Generate2 where min and max value can be specified. See updates on mapwingis.codeplex.com.
Regards,
Sergei
Forum: MapWindow 4 - ActiveX Control Programming
Forum: MapWindow 4 - ActiveX Control Programming
1 year ago
Sergei
Chris,
1. You shouldn't call: cs.set_Item(i, cat);
cs.get_Item(i) provides a reference to the category (not a copy of it). set_Item should be used only if you've created new Category.
2. In your code you duplicate functionality that already implemented in MapWinGIS. I suppose the same effect can be achieved by automatic generation of categories with ctEqualIntervals classification. See s
Forum: MapWindow 4 - Plugins
Forum: MapWindow 4 - Plugins
1 year ago
Sergei
Miguelo,
You need to update dependent libraries as well, MapWinUtility in this case. The source is here:
Hope it'll help,
Sergei
Forum: MapWindow 4 - ActiveX Control Programming
Forum: MapWindow 4 - ActiveX Control Programming
1 year ago
Sergei
For automatic generation of categories you can use:
Shapefile.Categories.Generate(FieldIndex, classification, number_of_classes);
MapWinGIS.ColorScheme = new MapWinGIS.ColorScheme();
scheme.SetColors2(tkMapColor.Black, tkMapColor.White);
Shapefile.Categories.ApplyColorScheme(scheme);
I you want more control over color of each category, you need to set the color manually. ColorScheme clas
Forum: MapWindow 4 - ActiveX Control Programming
Forum: MapWindow 4 - ActiveX Control Programming
1 year ago
Sergei
The approach is:
1) to add categories with different colors:
ShapefileCategory cat = Shapefile.Categories.Add("Name1");
cat.DefaultDrawingOptions.FillColor = someColor;
2) to apply categories for shapes:
Shapefile.ShapeCategory(ShapeIndex) = CategoryIndex;
Also expressions can be used to specify which shapes fall into category. The 2 steps will like this:
ShapefileCat
Forum: MapWindow 4 - ActiveX Control Programming
Forum: MapWindow 4 - ActiveX Control Programming
1 year ago
Sergei
In new version of MapWinGIS you should use:
Shapefile.DefaultDrawingOptions.SetDefaultPointType(SomeType);
If several types of points are needed, shapefile categories should be used.
A sample code with new functionality:
A scheme for ShapeDrawingOptions class:
Hope it'll help,
Sergei
Forum: MapWindow 4 - ActiveX Control Programming
Forum: MapWindow 4 - ActiveX Control Programming
1 year ago
Sergei
Hi Tahir,
what objects do you have on your map (shapefiles, images, point icons, labels, charts)?
Forum: MapWindow 4 - ActiveX Control Programming
Forum: MapWindow 4 - ActiveX Control Programming
1 year ago
Sergei
Alan,
you can send your binaries to me: lsu mail by
I can try to debug MapWinGIS, as it's difficult to say what's wrong otherwise.
Forum: MapWindow 4 - ActiveX Control Programming
Forum: MapWindow 4 - ActiveX Control Programming
1 year ago
Sergei
24. Re: Draw a shape
Quick answer: per-shape options aren't supported any more, you should use ShapefileCategories instead. Some hints on how to use them are, for example, here:
Forum: MapWindow 4 - ActiveX Control Programming
Forum: MapWindow 4 - ActiveX Control Programming
1 year ago
Sergei
I've never work with C++ Builder, but I'll try to help:
1. Provided that you installed MapWinGis properly (from the installer, with dependency libraries) image opening should work. If there is any doubt I'd recommend try to install MapWindow4 and open the image in it (it uses exactly the same call).
2. If the problem is in these lines:
a) I don't see where you create an instance of IIma
Forum: MapWindow 4 - ActiveX Control Programming
Forum: MapWindow 4 - ActiveX Control Programming
1 year ago
Sergei
See Image.UpsamplingMode and Image.DownsamplingMode properties. They should be set to imNone to disable interpolation.
Forum: MapWindow 4 - ActiveX Control Programming
Forum: MapWindow 4 - ActiveX Control Programming
1 year ago
Sergei
I'll add that MapWinGIS shows quite good performance comparing to other GIS. It's noticeably faster on shapefile drawing than QGis for example. Also relevant properties should be set to ensure good performance. Some info is here:
Forum: MapWindow 4 - ActiveX Control Programming
Forum: MapWindow 4 - ActiveX Control Programming
1 year ago
Sergei
GDI+, some things are drawn in GDI.
Forum: MapWindow 4 - ActiveX Control Programming
Forum: MapWindow 4 - ActiveX Control Programming
1 year ago
Sergei
I've made some more changes of selection handling in MW4.
Here is a memo that can be useful for plug-in developers.
1. Selection is no longer stored as color of individual shapes, but in Shapefile.ShapeSelected(ShapeIndex) property.
2. Shapes can be selected at several layers simutaneously. Selection isn't cleared when layer is changed. To get selected shapes of particular layer use prop
Forum: MapWindow 4 - Plugins
Forum: MapWindow 4 - Plugins
2 years ago
Sergei
Hi Everyone,
here are screenshots of the new labels form with support of expression. The checking of expression is carried out on the fly in the key_press event (see lower left corner of the screen). The forms for generation and style are merged as suggested by Phil.
Sergei
Made he images inline
Forum: MapWindow Developer Team
Forum: MapWindow Developer Team


