다음을 통해 공유


CircleHotSpot.Radius 속성

정의

CircleHotSpot 개체에 의해 정의된 원형 영역의 중심에서 가장자리까지의 거리를 가져오거나 설정합니다.

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

속성 값

Int32

CircleHotSpot 개체에 의해 정의된 원형 영역의 중심에서 가장자리까지의 거리를 픽셀 단위로 나타내는 정수입니다. 기본값은 0입니다.

예외

지정된 값이 0보다 작은 경우

예제

다음 코드 예제에서는 만드는 방법을 보여 줍니다.는 ImageMap 컨트롤 두 개가 포함 된 CircleHotSpot 개체입니다. 선언적으로; 만들어집니다. 해당 X, Y, 및 Radius 마찬가지로 속성은 선언적으로 설정 합니다. 다른 프로그래밍 방식으로 생성 되 고 X, Y, 및 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>

설명

합니다 Radius 속성을 사용 하면 가져오거나 센터에서이 정의 된 원형 영역의 가장자리 까지의 거리를 픽셀 단위로 나타내는 값을 설정할 CircleHotSpot 개체입니다. 완전히 정의 CircleHotSpot 개체에 대 한 값을 지정 해야 합니다 Radius 속성 뿐 XY 속성입니다.

적용 대상

추가 정보