This project is read-only.

How to add labels to an image file using the latest version?

Feb 7, 2011 at 12:04 PM

Dear all,

 One more question: could anybody advise how to add labels to an loaded image using the latest code? The code I used before you can find below.

Thank you,
Igor.



private
void btnDisplayImageLbl_Click(object sender, EventArgs e) { MapWinGIS.Image sf = new MapWinGIS.Image(); OpenFileDialog dlg = new OpenFileDialog(); dlg.Filter = sf.CdlgFilter; if (dlg.ShowDialog() == DialogResult.OK) { if (sf.Open(dlg.FileName, ImageType.USE_FILE_EXTENSION, false, null)) { sf.Labels.FontColor = RGB(Color.Navy); sf.Labels.FontColor2 = RGB(Color.Navy); sf.TransparencyColor = RGB(Color.Black); sf.TransparencyColor2 = RGB(Color.Black); sf.UpsamplingMode = tkInterpolationMode.imNone; sf.UseTransparencyColor = true; double xmin, ymin, zmin, xmax, ymax, zmax; sf.Extents.GetBounds(out xmin, out ymin, out zmin, out xmax, out ymax, out zmax); double xrange = xmax - xmin, xstep = xrange /10; double yrange = ymax - ymin, ystep = yrange / 10; Random rnd = new Random(); for (int i = 0; i < 10; i++) { sf.Labels.AddLabel(i.ToString(), sf.OriginalXllCenter + xstep * i, sf.OriginalYllCenter + ystep * i, 0, 0); } sf.Labels.ScaleLabels = true; sf.Labels.Alignment = tkLabelAlignment.laCenter; sf.Labels.Visible = true; int handle = axMap1.AddLayer(sf, true); axMap1.ZoomToLayer(handle); axMap1.Redraw(); } } }

Feb 10, 2011 at 12:27 AM

Igor,

thanks for pointing it out. I did synchronization of labels with shapefiles and images were omitted by mistake.

Will be fixed in the next update.

Thanks,

Sergei

Feb 16, 2011 at 1:39 AM

Sergei,

 

Just to confirm the latest version 58017 is working fine with this, so far didn'#t find any issues, still testing and let you know if something is found.

 

Regards,

Igor.