The GenerateLabels sample application is an example of a GeoMedia custom application.
It's primary purpose is to demonstrate using the GraphicsTextPipe to generate and display labels.
// Run the recordset through the CenterPointPipe to get their geometric centers. PPipe.CenterPointPipe oCenterPipe = new PPipe.CenterPointPipe(); oCenterPipe.InputGeometryFieldName = sGeomFld; oCenterPipe.InputRecordset = (GDO.GRecordset)oCSSPipe.OutputRecordset; oCenterPipe.OutputGeometryFieldName = sGeomFld + "2"; //Run the recordset through the GraphicsTextPipe to generate the labels. GMService.GraphicsTextPipe oTextPipe = new GMService.GraphicsTextPipe(); oTextPipe.InputGeometryFieldName = sGeomFld + "2"; oTextPipe.InputRecordset = (PClient.GRecordset)oCenterPipe.OutputRecordset; oTextPipe.OutputGeometryFieldName = sGeomFld + "3"; oTextPipe.StringContent = "[" + sAttribute + "]"; // Define Style PView.StyleService objstyleservice = new PView.StyleService(); PView.StyleDefinition objstyledef = null; objstyleservice.GetStyle("Text Style", out objstyledef); objstyledef.StyleProperties[PView.StylePropertyConstants.gmgroPropertyColor].Value = GetNextQBColor(); objstyledef.StyleProperties[PView.StylePropertyConstants.gmgroPropertyUnitType].Value = PView.StyleUnitTypeConstants.gmgroUnitTypeNonscalingPaper; objstyledef.StyleProperties[PView.StylePropertyConstants.gmgroPropertyFontName].Value = "Arial"; objstyledef.StyleProperties[PView.StylePropertyConstants.gmgroPropertyFontSize].Value = 352; // Define legend title PDBPipe.GMProperty objgmprop = new PDBPipe.GMProperty(); objgmprop.Name = "Title"; objgmprop.Value = sFeature + " Labels"; // Create the legend entry. PView.LegendEntry oLE = new PView.LegendEntry(); oLE.GeometryFieldName = sGeomFld + "3"; oLE.InputRecordset = (GDO.GRecordset)oTextPipe.OutputRecordset; oLE.Style = objstyledef; oLE.PropertySet.Append(objgmprop);
Compile the solution using Visual Studio 2013 and run the program, GenerateLabels.exe.
You will be prompted for an Access warehouse.
C# for GeoMedia 2015: HGDN / App_GenerateLabels_2015CS
Beginner