本文介绍了如何在Image Map控件中调整图像大小/调整其大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

Hi every one,

protected void Page_Load(object sender, EventArgs e)
{
    if (!Page.IsPostBack)
    {
       // here I want to resize/fit my image to ImageMap
        ImageMap1.ImageUrl = "~/images/today.jpg ";
        createhotspots();
    }
}
private void createhotspots()
{
    SqlConnection objcon = new SqlConnection(strCon);
    objcon.Open();
    string strQuery = "select * from cordinate";
    SqlCommand cmd = new SqlCommand(strQuery, objcon);
    SqlDataReader dr = cmd.ExecuteReader();
    while (dr.Read())
    {
        int top = Convert .ToInt32 ( dr[1].ToString());
        int bottom =Convert .ToInt32 ( dr[2].ToString());
        int left =Convert .ToInt32 ( dr[3].ToString());
        int right =Convert .ToInt32 ( dr[4].ToString());
        RectangleHotSpot RectangleHS = new RectangleHotSpot();
        RectangleHS.Top = top;
        RectangleHS.Left = left;
        RectangleHS.Right = right;
        RectangleHS.Bottom = bottom;
        ImageMap1.HotSpots.Add(RectangleHS);
    }
}



上面是我在Image Map中创建热点的代码.到这里为止.但是我想要的是在将图像加载到ImageMap控件时调整其大小/使其适合我的图像.我的图片尺寸更大.

谢谢您



Above is my code to create hot spots in Image Map. upto here its working. but what i want is to resize/fit my image while it loads to ImageMap Control. My images are of bigger size.

Thanking You

推荐答案


这篇关于如何在Image Map控件中调整图像大小/调整其大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 07:33