public Form1() { InitializeComponent(); this.Controls.Add(m_status_bar); string map_file = Application.StartupPath + "/../../../../../map/isle_of_wight.ctm1"; string style_file = Application.StartupPath + "/../../../../../style/standard.ctstyle"; string font_path = Application.StartupPath + "/../../../../../font/"; if (!System.IO.File.Exists(map_file)) // if we're running in an ordinary source tree, not an SDK { map_file = Application.StartupPath + "/../../../../../../../map/isle_of_wight.ctm1"; style_file = Application.StartupPath + "/../../../../../../../style/standard.ctstyle"; font_path = Application.StartupPath + "/../../../../../../../font/"; } m_framework = new CartoType.Framework(map_file, style_file, font_path + "DejaVuSans.ttf", this.ClientSize.Width, this.ClientSize.Height); m_framework.LoadFont(font_path + "DejaVuSans-Bold.ttf"); m_framework.LoadFont(font_path + "DejaVuSerif.ttf"); m_framework.LoadFont(font_path + "DejaVuSerif-Italic.ttf"); m_framework.SetResolutionDpi(144); m_framework.SetFollowMode(CartoType.FollowMode.LocationHeading); Text = m_framework.DataSetName(); m_map_renderer = new CartoType.MapRenderer(m_framework, Handle); m_graphics_acceleration = m_map_renderer.Valid(); CreateLegend(); }
public MainWindow() { InitializeComponent(); String font_path = "g:/cartotype/font/"; m_framework = new CartoType.Framework("g:/cartotype/map/corsica.ctm1", "g:/cartotype/style/standard.ctstyle", font_path + "DejaVuSans.ttf", 256, 256); m_framework.LoadFont(font_path + "DejaVuSans-Bold.ttf"); m_framework.LoadFont(font_path + "DejaVuSerif.ttf"); m_framework.LoadFont(font_path + "DejaVuSerif-Italic.ttf"); m_framework.SetResolutionDpi(144); m_framework.SetFollowMode(CartoType.FollowMode.LocationHeading); }
public Form1() { InitializeComponent(); // Uncomment the next line to add a status bar at the bottom of the display; however, it hides the copyright notice at present. // this.Controls.Add(m_status_bar); string map_file = Application.StartupPath + "/../../../../../map/isle_of_wight.ctm1"; string style_file = Application.StartupPath + "/../../../../../style/standard.ctstyle"; string font_path = Application.StartupPath + "/../../../../../font/"; if (!System.IO.File.Exists(map_file)) // if we're running in an ordinary source tree, not an SDK { map_file = Application.StartupPath + "/../../../../../../../map/isle_of_wight.ctm1"; style_file = Application.StartupPath + "/../../../../../../../style/standard.ctstyle"; font_path = Application.StartupPath + "/../../../../../../../font/"; } m_framework = new CartoType.Framework(map_file, style_file, font_path + "DejaVuSans.ttf", this.ClientSize.Width, this.ClientSize.Height); m_framework.LoadFont(font_path + "DejaVuSans-Bold.ttf"); m_framework.LoadFont(font_path + "DejaVuSerif.ttf"); m_framework.LoadFont(font_path + "DejaVuSerif-Italic.ttf"); m_framework.SetResolutionDpi(144); m_framework.SetFollowMode(CartoType.FollowMode.LocationHeading); m_framework.EnableLegend(m_draw_legend); Text = m_framework.DataSetName(); m_map_renderer = new CartoType.MapRenderer(m_framework, Handle); m_graphics_acceleration = m_map_renderer.Valid(); // Uncomment the next line to create a legend (map key). // CreateLegend(); // Sample code to insert a green pushpin. // String s = CartoType.Util.SetAttribute("", "_color", "green"); // long id = 0; // double lon = -1.289708; // double lat = 50.655351; // m_framework.InsertPointMapObject(0, "pushpin", lon, lat, CartoType.CoordType.Degree, s, 0,ref id, false); }
public Form1() { InitializeComponent(); this.Controls.Add(m_status_bar); string map_file = Application.StartupPath + "/../../../../data/boston.ctm1"; string style_file = Application.StartupPath + "/../../../../data/standard.ctstyle"; string font_path = Application.StartupPath + "/../../../../data/"; if (!System.IO.File.Exists(map_file)) // if we're running in an ordinary source tree, not an SDK { map_file = Application.StartupPath + "/../../../../../../test/data/ctm1/boston.ctm1"; style_file = Application.StartupPath + "/../../../../../../style/standard.ctstyle"; font_path = Application.StartupPath + "/../../../../../../font/"; } m_framework = new CartoType.Framework(map_file, style_file, font_path + "DejaVuSans.ttf", this.ClientSize.Width, this.ClientSize.Height); m_framework.LoadFont(font_path + "DejaVuSans-Bold.ttf"); m_framework.LoadFont(font_path + "DejaVuSerif.ttf"); m_framework.LoadFont(font_path + "DejaVuSerif-Italic.ttf"); m_framework.SetResolutionDpi(144); m_framework.SetScaleDenominator(50000); long id = 0; m_framework.InsertPointMapObject(m_framework.GetMemoryMapHandle(), "amenity/minor", -71.0824, 42.3527, CartoType.CoordType.Degree, "Graham's Pub", CartoType.Util.IntAttribute("pub", 0), ref id, false); m_framework.SetViewCenter(-71.0824, 42.3527, CartoType.CoordType.Degree); m_framework.SetFollowMode(CartoType.FollowMode.LocationHeading); Text = m_framework.DataSetName(); }