• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# NET.GPoint类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中GMap.NET.GPoint的典型用法代码示例。如果您正苦于以下问题:C# GPoint类的具体用法?C# GPoint怎么用?C# GPoint使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



GPoint类属于GMap.NET命名空间,在下文中一共展示了GPoint类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: CacheTiles

        bool CacheTiles(ref MapType[] types, int zoom, GPoint p)
        {
            foreach(MapType type in types)
             {
            Exception ex;
            PureImage img;

            // tile number inversion(BottomLeft -> TopLeft) for pergo maps
            if(type == MapType.PergoTurkeyMap)
            {
               img = GMaps.Instance.GetImageFrom(type, new GPoint(p.X, maxOfTiles.Height - p.Y), zoom, out ex);
            }
            else // ok
            {
               img = GMaps.Instance.GetImageFrom(type, p, zoom, out ex);
            }

            if(img != null)
            {
               img.Dispose();
               img = null;
            }
            else
            {
               return false;
            }
             }
             return true;
        }
开发者ID:LeoTosti,项目名称:x-drone,代码行数:29,代码来源:TilePrefetcher.cs


示例2: GRect

 public GRect(GPoint location, GSize size)
 {
    this.x = location.X;
    this.y = location.Y;
    this.width = size.Width;
    this.height = size.Height;
 }
开发者ID:mikhp,项目名称:greatmaps,代码行数:7,代码来源:GRect.cs


示例3: OnRender

            public override void OnRender(Graphics g)
            {
                base.OnRender(g);

                if (wprad == 0 || Overlay.Control == null)
                    return;

                // if we have drawn it, then keep that color
                if (!initcolor.HasValue)
                    Color = Color.White;

                //wprad = 300;

                // undo autochange in mouse over
                //if (Pen.Color == Color.Blue)
                //  Pen.Color = Color.White;

                double width = (Overlay.Control.MapProvider.Projection.GetDistance(Overlay.Control.FromLocalToLatLng(0, 0), Overlay.Control.FromLocalToLatLng(Overlay.Control.Width, 0)) * 1000.0);
                double height = (Overlay.Control.MapProvider.Projection.GetDistance(Overlay.Control.FromLocalToLatLng(0, 0), Overlay.Control.FromLocalToLatLng(Overlay.Control.Height, 0)) * 1000.0);
                double m2pixelwidth = Overlay.Control.Width / width;
                double m2pixelheight = Overlay.Control.Height / height;

                GPoint loc = new GPoint((int)(LocalPosition.X - (m2pixelwidth * wprad * 2)), LocalPosition.Y);// MainMap.FromLatLngToLocal(wpradposition);

                //if (m2pixelheight > 0.5)
                    g.DrawArc(Pen, new System.Drawing.Rectangle(LocalPosition.X - Offset.X - (int)(Math.Abs(loc.X - LocalPosition.X) / 2), LocalPosition.Y - Offset.Y - (int)Math.Abs(loc.X - LocalPosition.X) / 2, (int)Math.Abs(loc.X - LocalPosition.X), (int)Math.Abs(loc.X - LocalPosition.X)), 0, 360);

                    g.FillPie(new SolidBrush(Color.FromArgb(25,Color.Red)), LocalPosition.X - Offset.X - (int)(Math.Abs(loc.X - LocalPosition.X) / 2), LocalPosition.Y - Offset.Y - (int)Math.Abs(loc.X - LocalPosition.X) / 2,  Math.Abs(loc.X - LocalPosition.X), Math.Abs(loc.X - LocalPosition.X), 0, 360);

            }
开发者ID:jank3,项目名称:MissionPlanner,代码行数:30,代码来源:GMapMarkerAirport.cs


示例4: using

        bool PureImageCache.PutImageToCache(byte[] tile, int type, GPoint pos, int zoom)
        {
            bool ret = true;
            if (Created)
            {
                try
                {
                    string file = CacheLocation + Path.DirectorySeparatorChar + GMapProviders.TryGetProvider(type).Name + Path.DirectorySeparatorChar + zoom + Path.DirectorySeparatorChar + pos.Y + Path.DirectorySeparatorChar + pos.X + ".jpg";
                    string dir = Path.GetDirectoryName(file);
                    Directory.CreateDirectory(dir);
                    using (BinaryWriter sw = new BinaryWriter(File.OpenWrite(file)))
                    {
                        sw.Write(tile.ToArray());
                    }
                }
                catch (Exception ex)
                {
#if MONO
            Console.WriteLine("PutImageToCache: " + ex.ToString());
#endif
                    Debug.WriteLine("PutImageToCache: " + ex.ToString());
                    ret = false;
                }
            }
            return ret;
        }
开发者ID:jackmaynard,项目名称:MissionPlanner,代码行数:26,代码来源:MyImageCache.cs


示例5: MakeTileImageUrl

        string MakeTileImageUrl(GPoint pos, int zoom, string language)
        {
            string ret;

            ret = string.Format(CultureInfo.InvariantCulture, CustomURL + "&x={0}&y={1}&z={2}&s=", pos.X, pos.Y, zoom);

            return ret;
        }
开发者ID:ans10528,项目名称:MissionPlanner-MissionPlanner1.3.34,代码行数:8,代码来源:Earthbuilder.cs


示例6: MakeTileImageUrl

        string MakeTileImageUrl(GPoint pos, int zoom, string language)
        {
            string ret;

            ret = string.Format(CultureInfo.InvariantCulture, CustomURL, pos.X, pos.Y, zoom, mapsource, mapkey);

            return ret;
        }
开发者ID:xqiu35,项目名称:Senior_Design,代码行数:8,代码来源:Mapbox.cs


示例7: GetTileImage

        public override PureImage GetTileImage(GPoint pos, int zoom)
        {
            //string url = MakeTileImageUrl(pos, zoom, LanguageStr);

            //return GetTileImageUsingHttp(url);

            return null;
        }
开发者ID:ArduPilot,项目名称:MissionPlanner,代码行数:8,代码来源:Custom.cs


示例8: MakeTileImageUrl

        string MakeTileImageUrl(GPoint pos, int zoom, string language)
        {
            string ret;

            this.RefererUrl = "http://www.norgeskart.no/";

            ret = string.Format(CultureInfo.InvariantCulture, CustomURL, zoom, pos.X, pos.Y);

            return ret;
        }
开发者ID:duyisu,项目名称:MissionPlanner,代码行数:10,代码来源:Statkart_Topo2.cs


示例9: GetTileImage

        public override PureImage GetTileImage(GPoint pos, int zoom)
        {
            Console.Out.WriteLine("zoom = {0}, pos = {1}", zoom, pos);
            var imgStream = GetImgStreamForZoomPos(pos, zoom);
            if (imgStream == null) return null;

            var newStream = CopyStream(imgStream, true);
            var ret = TileImageProxy.FromStream(imgStream);
            ret.Data = newStream;
            ret.Data.Position = 0;
            newStream.Dispose();
            return ret;
        }
开发者ID:F1nZeR,项目名称:CourseWork,代码行数:13,代码来源:GMapImageProvider.cs


示例10: WellDetailPopup

        public WellDetailPopup(Form parent, BSE.Windows.Forms.Panel leftPanel, Well well, GPoint markerLocationOnParent, string dataConnString, Action<Well> updateMarkerPosition, Action<Well> deleteMarker)
        {
            this.FormClosing += Close_clicked;
            this.leftPanel = leftPanel;
            deleteMarkerAction = deleteMarker;
            updateMarkerPositionAction = updateMarkerPosition;
            connectionString = dataConnString;
            Owner = parent;
            StartPosition = FormStartPosition.Manual;
            Location = markerLocationOnParent;

            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;

            InitializeComponent();

            this.well = well;
            editLngBox.Text = well.Latitude;
            editLatBox.Text = well.Longitude;
            imageEditBackup = well.WellImage;
            wellImage.Image = well.WellImage;
            wellImage.SizeMode = PictureBoxSizeMode.Zoom;
        }
开发者ID:neilguilfoyle1,项目名称:WellsForZoeGpsWellMapperDesktop,代码行数:22,代码来源:WellDetailPopup.cs


示例11: TakePartFromOriginal

 public static Stream TakePartFromOriginal(Bitmap img, GPoint pos)
 {
     const int size = 512;
     var brush = new SolidBrush(Color.White);
     var resizedImg = new Bitmap(ResizeTo(img, size, size));
     var bmp = new Bitmap(256, 256);
     var graph = Graphics.FromImage(bmp);
     graph.FillRectangle(brush, new RectangleF(0, 0, size, size));
     var offsetX = (int) pos.X*256;
     var offsetY = (int) pos.Y*256;
     for (int x = 0; x < 256; x++)
     {
         for (int y = 0; y < 256; y++)
         {
             var curX = x + offsetX;
             var curY = y + offsetY;
             bmp.SetPixel(x, y, resizedImg.GetPixel(curX, curY));
         }
     }
     var resultStream = new MemoryStream();
     bmp.Save(resultStream, img.RawFormat);
     return resultStream;
 }
开发者ID:F1nZeR,项目名称:CourseWork,代码行数:23,代码来源:ImageHelper.cs


示例12: GetTileImage

        public override PureImage GetTileImage(GPoint pos, int zoom)
        {
            var px1 = GDALProvider.Instance.Projection.FromTileXYToPixel(pos);
            var px2 = px1;

            px1.Offset(0, 0);
            PointLatLng p1 = GDALProvider.Instance.Projection.FromPixelToLatLng(px1, zoom);

            px2.Offset(GDALProvider.Instance.Projection.TileSize.Width, -GDALProvider.Instance.Projection.TileSize.Height);
            PointLatLng p2 = GDALProvider.Instance.Projection.FromPixelToLatLng(px2, zoom);

            var bmp = GDAL.GetBitmap(p1.Lng, p1.Lat, p2.Lng, p2.Lat, GDALProvider.Instance.Projection.TileSize.Width, GDALProvider.Instance.Projection.TileSize.Height);

            if (bmp == null)
            {
                return null;
            }

            var ms = new MemoryStream();

            bmp.Save(ms, System.Drawing.Imaging.ImageFormat.Png);

            return new GMapImage() { Img = bmp, Data = ms };
        }
开发者ID:ArduPilot,项目名称:MissionPlanner,代码行数:24,代码来源:GDALProvider.cs


示例13: decode

        public String decode(Bitmap bitmap)
        {
            if (bitmap == null)
            {
                return null;
            }

            LuminanceSource source = new RGBLuminanceSource(bitmap, bitmap.Width, bitmap.Height);
            BinaryBitmap binaryBitmap = new BinaryBitmap(new HybridBinarizer(source));

            try
            {
                Result result = this.reader.decode(binaryBitmap);

                if (result != null)
                {
                    String[] resultToken = result.Text.Split(';');

                    double lat = Convert.ToDouble(resultToken[0]);
                    double lng = Convert.ToDouble(resultToken[1]);

                    double distance = Convert.ToDouble(resultToken[2]);
                    GPoint pointA = new GPoint(Convert.ToInt32(result.ResultPoints[1].X), Convert.ToInt32(result.ResultPoints[1].Y));
                    GPoint pointB = new GPoint(Convert.ToInt32(result.ResultPoints[2].X), Convert.ToInt32(result.ResultPoints[2].Y));

                    MapOverlayForm.Instance.SetMapScale(pointA, pointB, distance);
                    MapOverlayForm.Instance.RotationAngle = Convert.ToSingle(this.computeRotation(result.ResultPoints));
                    MapOverlayForm.Instance.MoveMapToLocalPosition(this.computeCenter(result.ResultPoints), new GMap.NET.PointLatLng(lat, lng));
                }
                return result.Text;
            }
            catch (ReaderException)
            {
                return null;
            }
        }
开发者ID:kr1schan,项目名称:PresenceSimulator,代码行数:36,代码来源:MapWithQRCodeReader.cs


示例14: OnRender

        public override void OnRender(Graphics g)
        {
            base.OnRender(g);

            if (wprad == 0 || MainMap == null)
                return;

            // undo autochange in mouse over
            if (Pen.Color == Color.Blue)
                Pen.Color = Color.White;

            double width = (MainMap.MapProvider.Projection.GetDistance(MainMap.FromLocalToLatLng(0, 0), MainMap.FromLocalToLatLng(MainMap.Width, 0)) * 1000.0);
            double height = (MainMap.MapProvider.Projection.GetDistance(MainMap.FromLocalToLatLng(0, 0), MainMap.FromLocalToLatLng(MainMap.Height, 0)) * 1000.0);
            double m2pixelwidth = MainMap.Width / width;
            double m2pixelheight = MainMap.Height / height;

            GPoint loc = new GPoint((int)(LocalPosition.X - (m2pixelwidth * wprad * 2)), LocalPosition.Y);// MainMap.FromLatLngToLocal(wpradposition);
            try
            {
                g.DrawArc(Pen, new System.Drawing.Rectangle((int)(LocalPosition.X - Offset.X - (Math.Abs(loc.X - LocalPosition.X) / 2)), (int)(LocalPosition.Y - Offset.Y - Math.Abs(loc.X - LocalPosition.X) / 2), (int)(Math.Abs(loc.X - LocalPosition.X)), (int)(Math.Abs(loc.X - LocalPosition.X))), 0, 360);
            }
            catch { }

        }
开发者ID:cooldragon1,项目名称:mw-wingui,代码行数:24,代码来源:common.cs


示例15: MakeTileImageUrl

        string MakeTileImageUrl(GPoint pos, int zoom, string language)
        {
            var px1 = Projection.FromTileXYToPixel(pos);
            var px2 = px1;

            px1.Offset(0, Projection.TileSize.Height);
            PointLatLng p1 = Projection.FromPixelToLatLng(px1, zoom);

            px2.Offset(Projection.TileSize.Width, 0);
            PointLatLng p2 = Projection.FromPixelToLatLng(px2, zoom);

            string ret;

            string extra = "?";

            if (CustomWMSURL.Contains("?"))
                extra = "&";

            //if there is a layer, use it  
            if (szWmsLayer != "")
            {
                ret = string.Format(CultureInfo.InvariantCulture,
                    CustomWMSURL + extra + "VERSION=1.1.1&REQUEST=GetMap&SERVICE=WMS&layers=" + szWmsLayer +
                    "&styles=&bbox={0},{1},{2},{3}&width={4}&height={5}&srs=EPSG:4326&format=image/png", p1.Lng, p1.Lat,
                    p2.Lng, p2.Lat, Projection.TileSize.Width, Projection.TileSize.Height);
            }
            else
            {
                ret = string.Format(CultureInfo.InvariantCulture,
                    CustomWMSURL + extra +
                    "VERSION=1.1.1&REQUEST=GetMap&SERVICE=WMS&styles=&bbox={0},{1},{2},{3}&width={4}&height={5}&srs=EPSG:4326&format=image/png",
                    p1.Lng, p1.Lat, p2.Lng, p2.Lat, Projection.TileSize.Width, Projection.TileSize.Height);
            }

            return ret;
        }
开发者ID:duyisu,项目名称:MissionPlanner,代码行数:36,代码来源:WMSProvider.cs


示例16: OffsetNegative

 public void OffsetNegative(GPoint p)
 {
     Offset(-p.X, -p.Y);
 }
开发者ID:Jeffiy,项目名称:ypmap,代码行数:4,代码来源:GPoint.cs


示例17: MakeTileImageUrl

 private string MakeTileImageUrl(GPoint pos, int zoom, string language)
 {
     string str = string.Format(UrlFormat, pos.X, pos.Y, zoom);
     Console.WriteLine("url:" + str);
     return str;
 }
开发者ID:CraigElder,项目名称:MissionPlanner,代码行数:6,代码来源:AMapSateliteProvider.cs


示例18: GetTileImage

 public override PureImage GetTileImage(GPoint pos, int zoom)
 {
     string url = this.MakeTileImageUrl(pos, zoom, GMapProvider.LanguageStr);
     return base.GetTileImageUsingHttp(url);
 }
开发者ID:CraigElder,项目名称:MissionPlanner,代码行数:5,代码来源:AMapSateliteProvider.cs


示例19: PutImageToCache

        public bool PutImageToCache(MemoryStream tile, MapType type, GPoint pos, int zoom)
        {
            bool ret = true;
             {
            if(Initialize())
            {
               try
               {
                  lock(cmdInsert)
                  {
                     cnSet.Ping();

                     if(cnSet.State != ConnectionState.Open)
                     {
                        cnSet.Open();
                     }

                     cmdInsert.Parameters["@type"].Value = (int)type;
                     cmdInsert.Parameters["@zoom"].Value = zoom;
                     cmdInsert.Parameters["@x"].Value = pos.X;
                     cmdInsert.Parameters["@y"].Value = pos.Y;
                     cmdInsert.Parameters["@tile"].Value = tile.GetBuffer();
                     cmdInsert.ExecuteNonQuery();
                  }
               }
               catch(Exception ex)
               {
                  Debug.WriteLine(ex.ToString());
                  ret = false;
                  Dispose();
               }
            }
             }
             return ret;
        }
开发者ID:Jeffiy,项目名称:ypmap,代码行数:35,代码来源:MySQLPureImageCache.cs


示例20: GetImageFromCache

        public PureImage GetImageFromCache(MapType type, GPoint pos, int zoom)
        {
            PureImage ret = null;
             {
            if(Initialize())
            {
               try
               {
                  object odata = null;
                  lock(cmdFetch)
                  {
                     cnGet.Ping();

                     if(cnGet.State != ConnectionState.Open)
                     {
                        cnGet.Open();
                     }

                     cmdFetch.Parameters["@type"].Value = (int)type;
                     cmdFetch.Parameters["@zoom"].Value = zoom;
                     cmdFetch.Parameters["@x"].Value = pos.X;
                     cmdFetch.Parameters["@y"].Value = pos.Y;
                     odata = cmdFetch.ExecuteScalar();
                  }

                  if(odata != null && odata != DBNull.Value)
                  {
                     byte[] tile = (byte[])odata;
                     if(tile != null && tile.Length > 0)
                     {
                        if(GMapProvider.TileImageProxy != null)
                        {
                           ret = GMapProvider.TileImageProxy.FromArray(tile);
                        }
                     }
                     tile = null;
                  }
               }
               catch(Exception ex)
               {
                  Debug.WriteLine(ex.ToString());
                  ret = null;
                  Dispose();
               }
            }
             }
             return ret;
        }
开发者ID:Jeffiy,项目名称:ypmap,代码行数:48,代码来源:MySQLPureImageCache.cs



注:本文中的GMap.NET.GPoint类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# NET.PointLatLng类代码示例发布时间:2022-05-26
下一篇:
C# DAL.ProjectDbContext类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap