PolygonHotSpot.GetCoordinates メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > PolygonHotSpot.GetCoordinates メソッドの意味・解説 

PolygonHotSpot.GetCoordinates メソッド

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

PolygonHotSpot オブジェクトの各頂点座標を表す文字列を返します

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

Public Overrides Function
 GetCoordinates As String
Dim instance As PolygonHotSpot
Dim returnValue As String

returnValue = instance.GetCoordinates
public override string GetCoordinates ()
public:
virtual String^ GetCoordinates () override
public String GetCoordinates ()

戻り値
PolygonHotSpot オブジェクトの各頂点座標を表す文字列。既定値空の文字列 ("") です。

解説解説

GetCoordinates メソッドは、PolygonHotSpot オブジェクトの各頂点座標を表す文字列を返します。このメソッド返す文字列は、Coordinates プロパティ現在の値です。

GetCoordinates メソッドは、PolygonHotSpotレンダリングする際に、その座標使用するテキスト取得するために、ASP.NET によって内部的に使用されます。返される文字列は、ブラウザマークアップ言語固有です。

使用例使用例

3 つの PolygonHotSpot オブジェクトを持つ ImageMap コントロール作成する方法次のコード例示します。各 PolygonHotSpot オブジェクトは、地図上の地理的な領域表しますユーザーPolygonHotSpot オブジェクトクリックすると、サーバーへのポストバックが行われますGetCoordinates メソッドは、多角形の各頂点座標取得しラベル表示します

<%@ Page Language="VB" %>

<script runat="server">
  
  Sub RegionMap_Clicked(ByVal sender As
 Object, ByVal e As ImageMapEventArgs)
    Dim coordinates As String
        
    ' When a user clicks a hot spot, display
    ' the coordinates of the hot spot's vertices.
    Select Case (e.PostBackValue)
      
      Case ("Western")
        coordinates = Regions.HotSpots(0).GetCoordinates()
        Message1.Text = "The coordinates are " &
 coordinates
      
      Case ("Northern")
        coordinates = Regions.HotSpots(1).GetCoordinates()
        Message1.Text = "The coordinates are " &
 coordinates
      
      Case ("Southern")
        coordinates = Regions.HotSpots(2).GetCoordinates()
        Message1.Text = "The coordinates are " &
 coordinates
      
      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.GetCoordinates Example</title>
</head>
  <body>
    <form id="Form1" runat="server">
    
      <h3>PolygonHotSpot.GetCoordinates 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 coordinates;

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

      case "Southern":
        coordinates = Regions.HotSpots[2].GetCoordinates();
        Message1.Text = "The coordinates are " + coordinates;
        break;

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

<html>
<head id="Head1" runat="server">
  <title>PolygonHotSpot.GetCoordinates Example</title>
</head>
  <body>
    <form id="Form1" runat="server">
    
      <h3>PolygonHotSpot.GetCoordinates 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 クラス ライブラリ リファレンス」からPolygonHotSpot.GetCoordinates メソッドを検索した結果を表示しています。
Weblioに収録されているすべての辞書からPolygonHotSpot.GetCoordinates メソッドを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からPolygonHotSpot.GetCoordinates メソッド を検索

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

辞書ショートカット

すべての辞書の索引

PolygonHotSpot.GetCoordinates メソッドのお隣キーワード
検索ランキング

   

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



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

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

©2025 GRAS Group, Inc.RSS