需要帮助将红点放在图像映射中 [英] need to help to put red point in image map

查看:82
本文介绍了需要帮助将红点放在图像映射中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,我需要在图片中放置红点的代码,比如谷歌地图的点可以看到居住的人吗?

解决方案

我希望这有助于你。

添加十字图像



 使用(图片图片= Image.FromFile( @  C:\ Users \Public\Pictures\Sample Pictures \ Koala.jpg))
使用(Graphics imageGraphics = Graphics.FromImage(image))
{
/// 绘制交叉点
点数点= 点(image.Width / 2 ,image.Height / 2 ) ;
imageGraphics.DrawLine( new Pen(Color.Red),point.X - 5 , point.Y,point.X + 5 ,point.Y);
imageGraphics.DrawLine( new Pen(Color.Red),point.X,point.Y - 5 ,point.X,point.Y + 5 );
image.Save( @ C:\ Users \Public \Pictures \Sample Pictures \\ \\test2.jpg);

}



但是如果你想直接使用这些地图。所以这里是代码(使用库Google.Api.Maps.Service.dll)



  var  map =  new  StaticMap(); 
map.Center = 49.78173 13.36669;
map.Zoom = 17;
map.Size = 500x400;
map.Sensor = true;
map.Markers = 49.78173 13.36669;

使用 var wc = new WebClient())
{

pictureBox1.Image = Image.FromStream(wc.OpenRead(map.ToUri()));
}


这是一个用于转换C#/ VB的超级工具http://www.developerfusion.com/tools/转换/ CSHARP到VB /

hello , i need code for put red point in image ,such as the point for google map to see the people where live ?

解决方案

Hi, I hope this helps you.
Add cross in image

using (Image image = Image.FromFile(@"C:\Users\Public\Pictures\Sample Pictures\Koala.jpg"))
using (Graphics imageGraphics = Graphics.FromImage(image))
{
    ///point for draw cross
    Point point = new Point(image.Width / 2, image.Height / 2);
    imageGraphics.DrawLine(new Pen(Color.Red), point.X - 5, point.Y, point.X + 5, point.Y);
    imageGraphics.DrawLine(new Pen(Color.Red), point.X, point.Y - 5, point.X, point.Y + 5);
    image.Save(@"C:\Users\Public\Pictures\Sample Pictures\test2.jpg");

}


But if you want to use the maps directly. so here is the code (use the library Google.Api.Maps.Service.dll)

var map = new StaticMap();
         map.Center = "49.78173 13.36669";
         map.Zoom = "17";
         map.Size = "500x400";
         map.Sensor = "true";
         map.Markers = "49.78173 13.36669";

         using (var wc = new WebClient())
         {

             pictureBox1.Image = Image.FromStream(wc.OpenRead(map.ToUri()));
         }


This is a super tool for converting C # / VB http://www.developerfusion.com/tools/convert/csharp-to-vb/


这篇关于需要帮助将红点放在图像映射中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆