使用vb.net的世界历史 [英] history of the world using vb.net

查看:55
本文介绍了使用vb.net的世界历史的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我正在使用Vb.net和sql server开发项目.在这里,基本上我已获得了世界地图,当我单击任何特定国家(例如,美国/北美)时,就会显示美国的完整历史.现在的问题是,假设我选择了任何国家,即如果将鼠标光标放在某个国家,那么我希望整个国家都被勾勒出轮廓(如单个图片),当我单击它时,它应该打开另一个选项卡.我想要尽可能避免超链接或按钮...

希望您理解了这个问题...如果不清楚,请告诉我尝试纠正它.

Thankyou

Hi,
I''m developing a project using Vb.net and sql server.Here basically i got the map of the world and when i click on any particular country [eg- USA/North America] then the complete history of The States will appear.Now the question is that suppose I select any country ie if my mouse cursor is placed on a country then i want the whole country to be outline [like an individual pic] and when i click on it , it should open another tab .I want to avoid hyperlink or a button as far as possible...

Hope you understood the question...If its not clear do tell I''l try to correct it.

Thankyou

推荐答案

您可以使用 IsVisible() [ ^ ]方法.

为每个国家/地区创建区域将需要大量的手工工作.或者,您可以获取可以转换的测地数据.

完成后,您可以从鼠标指针的位置获取被点击的国家.

这是一个示例:
You could use the System.Drawing.Region[^] class and its IsVisible()[^] method.

Will need quite some manual work to create the Regions for each country. Or you can get geodesic data you can convert.

When done with that, you can get the clicked country from the mouse pointer''s position.

Here is an example:
public static void Example()
{
    System.Drawing.Region someCountryOutline = new Region(
        new System.Drawing.Drawing2D.GraphicsPath(
            new PointF[]{
                new PointF(0F,0F),
                new PointF(200F,0F),
                new PointF(220F, 20F),
                new PointF(220F, 200F),
                new PointF(0F,200F)
            },
            new byte[]{
                (byte)System.Drawing.Drawing2D.PathPointType.Start,
                (byte)System.Drawing.Drawing2D.PathPointType.Line,
                (byte)System.Drawing.Drawing2D.PathPointType.Line,
                (byte)System.Drawing.Drawing2D.PathPointType.Line,
                (byte)(System.Drawing.Drawing2D.PathPointType.Line
                       |System.Drawing.Drawing2D.PathPointType.CloseSubpath)
            }
        )
    );

    if (someCountryOutline.IsVisible(WorldMapControl.MousePosition))
    {
        Console.WriteLine("Mouse within country borders.");
    }
}



但是,您将需要在您选择的某些坐标系中更改坐标.您最终将获得每个国家一个地区. new Region()东西属于一些初始化代码. IsVisible()部分将在其中一个鼠标事件处理程序中进行处理.



You will, however need to change the co-ordinates in some co-ordinate system of your choice. You will end up with one Region per country. The new Region() stuff belongs in some initialization code. The IsVisible() part will be processed in one of the mouse event handlers.


这篇关于使用vb.net的世界历史的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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