PolygonHotSpotとは? わかりやすく解説

PolygonHotSpot クラス

メモ : このクラスは、.NET Framework version 2.0新しく追加されたものです。

ImageMap コントロール多角形ホットスポット領域定義します。このクラス継承できません。

名前空間: System.Web.UI.WebControls
アセンブリ: System.Web (system.web.dll 内)
構文構文

Public NotInheritable Class
 PolygonHotSpot
    Inherits HotSpot
Dim instance As PolygonHotSpot
public sealed class PolygonHotSpot : HotSpot
public final class PolygonHotSpot extends HotSpot
public final class PolygonHotSpot extends
 HotSpot
解説解説

このクラスは、ImageMap コントロール多角形ホット スポット領域定義しますPolygonHotSpot は、不規則な形状ホットスポット領域ImageMap コントロール定義する場合に便利です。たとえば、地図中に個別領域定義するために使用できます

PolygonHotSpot領域定義するには、PolygonHotSpot オブジェクトの各頂点座標指定する文字列Coordinates プロパティ設定します多角形頂点とは、多角形の 2 辺が交わる点です。

PolygonHotSpot オブジェクトクリックすると、URL へのページ移動サーバーへのポストバック生成が行われるか、または何も起こりません。この動作は、HotSpotMode プロパティ指定しますURL移動するには、HotSpotMode プロパティHotSpotMode.Navigate設定し、NavigateUrl プロパティ使用して移動先の URL指定しますサーバーポストバックするには、HotSpotMode プロパティHotSpotMode.PostBack設定し、PostBackValue プロパティ使用して PolygonHotSpot オブジェクトの名前を指定します。この名前は、PolygonHotSpotクリックされたときに、ImageMapEventArgs イベント データ渡されます。PolygonHotSpot オブジェクトが何も動作行わないようにするには、HotSpotMode プロパティHotSpotMode.Inactive設定します

使用例使用例

3 つの PolygonHotSpot オブジェクトを持つ ImageMap コントロール作成する方法次のコード例示します。各 PolygonHotSpot オブジェクトは、地図上の地理的な領域表しますユーザーPolygonHotSpot オブジェクトクリックすると、サーバーへのポストバックが行われ、ホット スポット種類と名前がラベル表示されます。

<%@ Page Language="VB" %>

<script runat="server">
  
  Sub RegionMap_Clicked(ByVal sender As
 Object, ByVal e As ImageMapEventArgs)
    Dim hotSpotType As String
        
    ' When a user clicks a hot spot, display
    ' the hot spot's type and name.
    Select Case (e.PostBackValue)
      
      Case ("Western")
        hotSpotType = Regions.HotSpots(0).ToString()
        Message1.Text = "You selected " & hotSpotType
 & " " & e.PostBackValue
      
      Case ("Northern")
        hotSpotType = Regions.HotSpots(1).ToString()
        Message1.Text = "You selected " & hotSpotType
 & " " & e.PostBackValue
      
      Case ("Southern")
        hotSpotType = Regions.HotSpots(2).ToString()
        Message1.Text = "You selected " & hotSpotType
 & " " & e.PostBackValue
      
      Case Else
        Message1.Text = "You did not click a valid hot spot region."
    
    End Select

  End Sub
  
</script>

<html>
<head id="Head1" runat="server">
  <title>PolygonHotSpot Class Example</title>
</head>
  <body>
    <form id="Form1" runat="server">
    
      <h3>PolygonHotSpot Example</h3>
      
      <!-- Change or remove the width and
 height attributes as
           appropriate for your image. -->
      <asp:imagemap id="Regions"           
        imageurl="Images/RegionMap.jpg"
        alternatetext="Sales Regions" 
        hotspotmode="PostBack"
        width="400"
        height="400"
        onclick="RegionMap_Clicked"   
        runat="Server">            
          
        <asp:PolygonHotSpot 
          coordinates="0,0,176,0,125,182,227,400,0,400"
         
          postbackvalue="Western"
          alternatetext="Western Region">
        </asp:PolygonHotSpot>
          
        <asp:PolygonHotSpot 
          coordinates="177,0,400,0,400,223,335,154,127,180"
         
          postbackvalue="Northern"
          alternatetext="Northern Region">
        </asp:PolygonHotSpot>
        
        <asp:PolygonHotSpot 
          coordinates="128,185,335,157,400,224,400,400,228,400"
         
          postbackvalue="Southern"
          alternatetext="Southern Region">
        </asp:PolygonHotSpot>
      
      </asp:imagemap>
            
      <br /><br />
          
      <asp:label id="Message1"
        runat="Server">
      </asp:label>                 
                 
    </form>      
  </body>
</html>
<%@ Page Language="C#" %>

<script runat="server">
  
  void RegionMap_Clicked (object sender, ImageMapEventArgs e)
  {
    string hotSpotType;

    // When a user clicks a hot spot, display
    // the hot spot's type and name.
    switch (e.PostBackValue)
    {
      case "Western":
        hotSpotType = Regions.HotSpots[0].ToString();
        Message1.Text = "You selected " + hotSpotType + " " +
 e.PostBackValue;
        break;
        
      case "Northern":
        hotSpotType = Regions.HotSpots[1].ToString();
        Message1.Text = "You selected " + hotSpotType + " " +
 e.PostBackValue;
        break;

      case "Southern":
        hotSpotType = Regions.HotSpots[2].ToString();
        Message1.Text = "You selected " + hotSpotType + " " +
 e.PostBackValue;
        break;

      default:
        Message1.Text = "You did not click a valid hot spot region.";
        break;
    }
  }  
  
</script>

<html>
<head id="Head1" runat="server">
  <title>PolygonHotSpot Class Example</title>
</head>
  <body>
    <form id="Form1" runat="server">
    
      <h3>PolygonHotSpot Example</h3>
      
      <!-- Change or remove the width and height attributes as
           appropriate for your image. -->
      <asp:imagemap id="Regions"           
        imageurl="Images/RegionMap.jpg"
        alternatetext="Sales Regions" 
        hotspotmode="PostBack"
        width="400"
        height="400"
        onclick="RegionMap_Clicked"   
        runat="Server">            
          
        <asp:PolygonHotSpot 
          coordinates="0,0,176,0,125,182,227,400,0,400"         
          postbackvalue="Western"
          alternatetext="Western Region">
        </asp:PolygonHotSpot>
          
        <asp:PolygonHotSpot 
          coordinates="177,0,400,0,400,223,335,154,127,180"         
          postbackvalue="Northern"
          alternatetext="Northern Region">
        </asp:PolygonHotSpot>
        
        <asp:PolygonHotSpot 
          coordinates="128,185,335,157,400,224,400,400,228,400"       
  
          postbackvalue="Southern"
          alternatetext="Southern Region">
        </asp:PolygonHotSpot>
      
      </asp:imagemap>
            
      <br /><br />
          
      <asp:label id="Message1"
        runat="Server">
      </asp:label>                 
                 
    </form>      
  </body>
</html>
.NET Framework のセキュリティ.NET Frameworkセキュリティ
継承階層継承階層
System.Object
   System.Web.UI.WebControls.HotSpot
    System.Web.UI.WebControls.PolygonHotSpot
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

PolygonHotSpot コンストラクタ

メモ : このコンストラクタは、.NET Framework version 2.0新しく追加されたものです。

PolygonHotSpot クラス新しインスタンス初期化します。

名前空間: System.Web.UI.WebControls
アセンブリ: System.Web (system.web.dll 内)
構文構文

Dim instance As New PolygonHotSpot
public PolygonHotSpot ()
public:
PolygonHotSpot ()
public PolygonHotSpot ()
public function PolygonHotSpot ()
解説解説
使用例使用例

プログラムによって PolygonHotSpot オブジェクト作成しImageMap コントロール追加する方法次のコード例示しますImageMap コントロールには、宣言によって追加され別の 2 つPolygonHotSpot オブジェクト含まれます。PolygonHotSpot オブジェクトは、地図上の地理的な領域表しますユーザーPolygonHotSpot オブジェクトクリックすると、サーバーへのポストバックが行われ、ホット スポット種類と名前がラベル表示されます。

<%@ Page Language="VB" %>

<script runat="server">
  
  Sub Page_Load(ByVal sender As
 Object, ByVal e As EventArgs)
    ' Programmatically create a PolygonHotSpot.
    Dim Polygon1 As New
 PolygonHotSpot
    Polygon1.Coordinates = "128,185,335,157,400,224,400,400,228
,400"
    Polygon1.PostBackValue = "Southern"
    Polygon1.AlternateText = "Southern Region"
    
    ' Add it to the end of the ImageMap control's
    ' HotSpotCollection.
    Regions.HotSpots.Add(Polygon1)
  End Sub
  
  Sub RegionMap_Clicked(ByVal sender As
 Object, ByVal e As ImageMapEventArgs)
    Dim hotSpotType As String
        
    ' When a user clicks a hot spot, display
    ' the hot spot's type and name.
    Select Case (e.PostBackValue)
      
      Case ("Western")
        hotSpotType = Regions.HotSpots(0).ToString()
        Message1.Text = "You selected " & hotSpotType
 & " " & e.PostBackValue
      
      Case ("Northern")
        hotSpotType = Regions.HotSpots(1).ToString()
        Message1.Text = "You selected " & hotSpotType
 & " " & e.PostBackValue
      
      Case ("Southern")
        hotSpotType = Regions.HotSpots(2).ToString()
        Message1.Text = "You selected " & hotSpotType
 & " " & e.PostBackValue
      
      Case Else
        Message1.Text = "You did not click a valid hot spot region."
    
    End Select
  End Sub
  
</script>

<html>
<head id="Head1" runat="server">
  <title>PolygonHotSpot Constructor Example</title>
</head>
  <body>
    <form id="Form1" runat="server">
    
      <h3>PolygonHotSpot Constructor Example</h3>
      
      <!-- Change or remove the width and
 height attributes as
           appropriate for your image. -->
      <asp:imagemap id="Regions"           
        imageurl="Images/RegionMap.jpg"
        alternatetext="Sales Regions" 
        hotspotmode="PostBack"
        width="400"
        height="400"
        onclick="RegionMap_Clicked"   
        runat="Server">            
          
        <asp:PolygonHotSpot 
          coordinates="0,0,176,0,125,182,227,400,0,400"
         
          postbackvalue="Western"
          alternatetext="Western Region">
        </asp:PolygonHotSpot>
          
        <asp:PolygonHotSpot 
          coordinates="177,0,400,0,400,223,335,154,127,180"
         
          postbackvalue="Northern"
          alternatetext="Northern Region">
        </asp:PolygonHotSpot>
      
      </asp:imagemap>
            
      <br /><br />
          
      <asp:label id="Message1"
        runat="Server">
      </asp:label>                 
                 
    </form>      
  </body>
</html>
<%@ Page Language="C#" %>

<script runat="server">
  
  void Page_Load(object sender, EventArgs e)
  {  
    // Programmatically create a PolygonHotSpot.
    PolygonHotSpot Polygon1 = new PolygonHotSpot();
    Polygon1.Coordinates = "128,185,335,157,400,224,400,400,228,400";
    Polygon1.PostBackValue = "Southern";
    Polygon1.AlternateText = "Southern Region";
    
    // Add it to the end of the ImageMap control's
    // HotSpotCollection.
    Regions.HotSpots.Add(Polygon1);
  }
  
  void RegionMap_Clicked (object sender, ImageMapEventArgs e)
  {
    string hotSpotType;

    // When a user clicks a hot spot, display
    // the hot spot's type and name.
    switch (e.PostBackValue)
    {
      case "Western":
        hotSpotType = Regions.HotSpots[0].ToString();
        Message1.Text = "You selected " + hotSpotType + " " +
 e.PostBackValue;
        break;
        
      case "Northern":
        hotSpotType = Regions.HotSpots[1].ToString();
        Message1.Text = "You selected " + hotSpotType + " " +
 e.PostBackValue;
        break;

      case "Southern":
        hotSpotType = Regions.HotSpots[2].ToString();
        Message1.Text = "You selected " + hotSpotType + " " +
 e.PostBackValue;
        break;

      default:
        Message1.Text = "You did not click a valid hot spot region.";
        break;
    }
  }  
  
</script>

<html>
<head id="Head1" runat="server">
  <title>PolygonHotSpot Constructor Example</title>
</head>
  <body>
    <form id="Form1" runat="server">
    
      <h3>PolygonHotSpot Constructor Example</h3>
      
      <!-- Change or remove the width and height attributes as
           appropriate for your image. -->
      <asp:imagemap id="Regions"           
        imageurl="Images/RegionMap.jpg"
        alternatetext="Sales Regions" 
        hotspotmode="PostBack"
        width="400"
        height="400"
        onclick="RegionMap_Clicked"   
        runat="Server">            
          
        <asp:PolygonHotSpot 
          coordinates="0,0,176,0,125,182,227,400,0,400"         
          postbackvalue="Western"
          alternatetext="Western Region">
        </asp:PolygonHotSpot>
          
        <asp:PolygonHotSpot 
          coordinates="177,0,400,0,400,223,335,154,127,180"         
          postbackvalue="Northern"
          alternatetext="Northern Region">
        </asp:PolygonHotSpot>
      
      </asp:imagemap>
            
      <br /><br />
          
      <asp:label id="Message1"
        runat="Server">
      </asp:label>                 
                 
    </form>      
  </body>
</html>
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

PolygonHotSpot プロパティ


パブリック プロパティパブリック プロパティ

  名前 説明
パブリック プロパティ AccessKey  HotSpot 領域すばやく移動できるアクセス キー取得または設定します。 ( HotSpot から継承されます。)
パブリック プロパティ AlternateText  イメージ使用できない場合や、イメージサポートしないブラウザイメージ表示される場合に、ImageMap コントロールHotSpot オブジェクト表示する代替テキスト取得または設定します。 ( HotSpot から継承されます。)
パブリック プロパティ Coordinates PolygonHotSpot オブジェクトの各頂点を表す座標文字列
パブリック プロパティ HotSpotMode  HotSpotクリックされたときの、ImageMap コントロールHotSpot オブジェクト動作取得または設定します。 ( HotSpot から継承されます。)
パブリック プロパティ NavigateUrl  HotSpot オブジェクトクリックされたときの移動URL取得または設定します。 ( HotSpot から継承されます。)
パブリック プロパティ PostBackValue  HotSpotクリックされたときにイベント データ渡される HotSpot オブジェクトの名前を取得または設定します。 ( HotSpot から継承されます。)
パブリック プロパティ TabIndex  HotSpot 領域タブ インデックス取得または設定します。 ( HotSpot から継承されます。)
パブリック プロパティ Target  URL移動する HotSpot オブジェクトクリックされたときに、リンク先 Web ページ内容表示するウィンドウまたはフレーム取得または設定します。 ( HotSpot から継承されます。)
参照参照

関連項目

PolygonHotSpot クラス
System.Web.UI.WebControls 名前空間
ImageMap クラス
Coordinates

その他の技術情報

ImageMap Web サーバー コントロール

PolygonHotSpot メソッド


パブリック メソッドパブリック メソッド

プロテクト メソッドプロテクト メソッド
参照参照

関連項目

PolygonHotSpot クラス
System.Web.UI.WebControls 名前空間
ImageMap クラス
Coordinates

その他の技術情報

ImageMap Web サーバー コントロール

PolygonHotSpot メンバ

ImageMap コントロール多角形ホットスポット領域定義します。このクラス継承できません。

PolygonHotSpot データ型公開されるメンバを以下の表に示します


パブリック コンストラクタパブリック コンストラクタ
  名前 説明
パブリック メソッド PolygonHotSpot PolygonHotSpot クラス新しインスタンス初期化します。
パブリック プロパティパブリック プロパティ
  名前 説明
パブリック プロパティ AccessKey  HotSpot 領域すばやく移動できるアクセス キー取得または設定します。(HotSpot から継承されます。)
パブリック プロパティ AlternateText  イメージ使用できない場合や、イメージサポートしないブラウザイメージ表示される場合に、ImageMap コントロールHotSpot オブジェクト表示する代替テキスト取得または設定します。(HotSpot から継承されます。)
パブリック プロパティ Coordinates PolygonHotSpot オブジェクトの各頂点を表す座標文字列
パブリック プロパティ HotSpotMode  HotSpotクリックされたときの、ImageMap コントロールHotSpot オブジェクト動作取得または設定します。(HotSpot から継承されます。)
パブリック プロパティ NavigateUrl  HotSpot オブジェクトクリックされたときの移動URL取得または設定します。(HotSpot から継承されます。)
パブリック プロパティ PostBackValue  HotSpotクリックされたときにイベント データ渡される HotSpot オブジェクトの名前を取得または設定します。(HotSpot から継承されます。)
パブリック プロパティ TabIndex  HotSpot 領域タブ インデックス取得または設定します。(HotSpot から継承されます。)
パブリック プロパティ Target  URL移動する HotSpot オブジェクトクリックされたときに、リンク先 Web ページ内容表示するウィンドウまたはフレーム取得または設定します。(HotSpot から継承されます。)
パブリック メソッドパブリック メソッド
プロテクト メソッドプロテクト メソッド
参照参照

関連項目

PolygonHotSpot クラス
System.Web.UI.WebControls 名前空間
ImageMap クラス
Coordinates

その他の技術情報

ImageMap Web サーバー コントロール



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「PolygonHotSpot」の関連用語

PolygonHotSpotのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



PolygonHotSpotのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS