CircleHotSpot.Y プロパティ

定義

CircleHotSpot オブジェクトによって定義される円形領域の中心の y 座標を取得または設定します。

public:
 property int Y { int get(); void set(int value); };
public int Y { get; set; }
member this.Y : int with get, set
Public Property Y As Integer

プロパティ値

CircleHotSpot オブジェクトによって定義される円形領域の中心の y 座標。 既定値は 0 です。

次のコード例では、2 つのCircleHotSpotオブジェクトを含むコントロールをImageMap作成する方法を示します。 1 つは宣言的に作成されます。プロパティ XY、および Radius プロパティも同様に宣言的に設定されます。 もう 1 つはプログラムによって作成され、その XY、および Radius プロパティはプログラムによって設定されます。 この例を正しく機能させるには、 プロパティに独自のイメージを ImageUrl 指定し、イメージへのパスを適切に更新して、アプリケーションがイメージを見つけられるようにする必要があります。

<%@ page language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
  void Page_Load (object sender, EventArgs e)
  {
    // Programmatically create a CircleHotSpot object.
    CircleHotSpot Circle1 = new CircleHotSpot ();

    // Set properties on the CircleHotSpot object.
    Circle1.HotSpotMode = HotSpotMode.Navigate;
    Circle1.NavigateUrl = "http://www.tailspintoys.com";
    Circle1.X = 145;
    Circle1.Y = 120;
    Circle1.Radius = 75;
    Circle1.AlternateText="Shop for toys";

    // Add the CirclHotSpot object to the
    // Shop ImageMap control's HotSpotCollection.         
    Shop.HotSpots.Add (Circle1);
  }

</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="head1" runat="server">
  <title>CircleHotSpot Properties Example</title>
</head>
  <body>
    <form id="form1" runat="server">
    
      <h3>CircleHotSpot Example</h3>
      
      <h4>Shopping Choices:</h4>
      
      <asp:imagemap id="Shop"           
        imageurl="Images/ShopChoice.jpg"
        alternatetext="Shopping choices" 
        runat="Server">
        
        <asp:circlehotspot
          navigateurl="http://www.cohowinery.com"
          x="145"
          y="290"
          radius="75"
          hotspotmode="Navigate"
          alternatetext="Shop for wine">
        </asp:circlehotspot>
        
      </asp:imagemap>
      
    </form>      
  </body>
</html>
<%@ page language="VB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
  Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
    
    ' Programmatically create a CircleHotSpot object.
    Dim Circle1 As New CircleHotSpot
    
    ' Set properties on the CircleHotSpot object.
    Circle1.HotSpotMode = HotSpotMode.Navigate
    Circle1.NavigateUrl = "http://www.tailspintoys.com"
    Circle1.X = 145
    Circle1.Y = 120
    Circle1.Radius = 75
    Circle1.AlternateText = "Shop for toys"
   
    ' Add the CirclHotSpot object to the
    ' Shop ImageMap control's HotSpotCollection.         
    Shop.HotSpots.Add(Circle1)
    
  End Sub

</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="head1" runat="server">
  <title>CircleHotSpot Example</title>
</head>
  <body>
    <form id="form1" runat="server">
    
      <h3>CircleHotSpot Properties Example</h3>
      
      <h4>Shopping Choices:</h4>
      
      <asp:imagemap id="Shop"           
        imageurl="Images/ShopChoice.jpg"
        alternatetext="Shopping choices" 
        runat="Server">
        
        <asp:circlehotspot
          navigateurl="http://www.cohowinery.com"
          x="145"
          y="290"
          radius="75"
          hotspotmode="Navigate"
          alternatetext="Shop for wine">
        </asp:circlehotspot>
        
      </asp:imagemap>
      
    </form>      
  </body>
</html>

注釈

Yプロパティを使用すると、このCircleHotSpotオブジェクトによって定義された円形領域の中心の y 座標を表す値を取得または設定できます。 オブジェクトをCircleHotSpot完全に定義するには、 プロパティと Radius プロパティの値と プロパティをY指定するX必要があります。

適用対象

こちらもご覧ください