1. <ul id="0c1fb"></ul>

      <noscript id="0c1fb"><video id="0c1fb"></video></noscript>
      <noscript id="0c1fb"><listing id="0c1fb"><thead id="0c1fb"></thead></listing></noscript>

      99热在线精品一区二区三区_国产伦精品一区二区三区女破破_亚洲一区二区三区无码_精品国产欧美日韩另类一区

      RELATEED CONSULTING
      相關(guān)咨詢
      選擇下列產(chǎn)品馬上在線溝通
      服務(wù)時(shí)間:8:30-17:00
      你可能遇到了下面的問題
      關(guān)閉右側(cè)工具欄

      新聞中心

      這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
      關(guān)于vb.net儀表盤源碼的信息

      如何用vb.net獲得網(wǎng)頁的源代碼

      Dim url As String=" 網(wǎng)址"

      成都創(chuàng)新互聯(lián)公司成立10多年來,這條路我們正越走越好,積累了技術(shù)與客戶資源,形成了良好的口碑。為客戶提供成都網(wǎng)站制作、做網(wǎng)站、網(wǎng)站策劃、網(wǎng)頁設(shè)計(jì)、申請(qǐng)域名、網(wǎng)絡(luò)營銷、VI設(shè)計(jì)、網(wǎng)站改版、漏洞修補(bǔ)等服務(wù)。網(wǎng)站是否美觀、功能強(qiáng)大、用戶體驗(yàn)好、性價(jià)比高、打開快等等,這些對(duì)于網(wǎng)站建設(shè)都非常重要,成都創(chuàng)新互聯(lián)公司通過對(duì)建站技術(shù)性的掌握、對(duì)創(chuàng)意設(shè)計(jì)的研究為客戶提供一站式互聯(lián)網(wǎng)解決方案,攜手廣大客戶,共同發(fā)展進(jìn)步。

      Dim httpReq As System.Net.HttpWebRequest

      Dim httpResp As System.Net.HttpWebResponse

      Dim httpURL As New System.Uri(url)

      httpReq = CType(WebRequest.Create(httpURL), HttpWebRequest)

      httpReq.Method = "GET"

      httpResp = CType(httpReq.GetResponse(), HttpWebResponse)

      httpReq.KeepAlive = False ' 獲取或設(shè)置一個(gè)值,該值指示是否與

      Internet資源建立持久連接。

      Dim reader As StreamReader = _

      New StreamReader(httpResp.GetResponseStream,

      System.Text.Encoding.GetEncoding(-0))

      Dim respHTML As String = reader.ReadToEnd() 'respHTML就是網(wǎng)頁源代碼

      VB.NET如何讓儀表指針繞某點(diǎn)旋轉(zhuǎn)

      你把問題想簡單點(diǎn),直接在PANEL空間上使用GD+畫指針就行了。算出兩點(diǎn)劃線還不容易么?用圖片的話需要旋轉(zhuǎn),而且鋸齒非常嚴(yán)重@!

      下載的.net源碼怎么運(yùn)行?

      如果你的計(jì)算機(jī)安裝了.Net環(huán)境的話,(Vista以上版本都默認(rèn)安裝了,XP需要下載.Net Framework來安裝),系統(tǒng)盤上Windows目錄下會(huì)有一個(gè)Microsoft.Net目錄,里面的2.0目錄里有相應(yīng)的編譯器。C#語言的編譯器是csc.exe,VB.Net語言的編譯器是vbc.exe。用命令行的方式就能把源碼編譯成可執(zhí)行程序。如csc 123.cs 123.exe。你也可以用集成開發(fā)環(huán)境,如VS2005或VS2008,用他們打開源碼,并添加一個(gè)解決方案,就能編譯并調(diào)試執(zhí)行。不過VS2005或VS2008都比較大,幾個(gè)G大小,另外還有一個(gè)比較小巧又好用的集成開發(fā)環(huán)境叫SharpDevelop,只有十幾M大小,他和VS2005幾乎一樣好用,并能生產(chǎn)支持Vista界面的程序,不過只能編譯C#源碼。

      VB.NET設(shè)計(jì)的窗體程序,有什么控件可以實(shí)現(xiàn)類似這種下載列表一樣的?

      如果是.NET平臺(tái)的,你可以使用ComponentOne Enterprise 全功能.NET控件集中的布局控件實(shí)現(xiàn)。也可以試試ComponentOne的LinearGauge 控件,這是一個(gè)線性儀表器,顯示為一個(gè)值和象征參考值的可選范圍。線性儀表盤(LinearGauge)控件提供了一個(gè) ShowText 屬性,用來決定哪些值以文本顯示。

      》》傳送門:網(wǎng)頁鏈接

      vb.net開發(fā)簡單的時(shí)鐘程序??高手救救我!

      個(gè)

      Hand類的代碼:

      Public MustInherit Class Hand

      Protected gp As GraphicsPath = New GraphicsPath()

      Protected gpBase As GraphicsPath = Nothing

      Protected midX As Integer = 150 ‘默認(rèn)的窗體

      Protected midY As Integer = 150 ‘中心位置

      ‘構(gòu)造器,得到窗體中心位置

      Public Sub New(ByVal theForm As Form1)

      midX = (theForm.ClientRectangle.Left + theForm.ClientRectangle.Right) / 2

      midY = (theForm.ClientRectangle.Top + theForm.ClientRectangle.Bottom) / 2

      End Sub

      MustOverride Sub Transform(ByVal d As DateTime)

      ‘繪制指針路徑

      Overridable Sub Draw(ByVal g As Graphics)

      Dim aPen As Pen = New Pen(Brushes.Black, 4F)

      g.DrawPath(aPen, gp)

      g.FillPath(Brushes.Black, gp)

      aPen.Dispose()

      End Sub

      ‘使用矩陣實(shí)現(xiàn)路徑(gp)的旋轉(zhuǎn)

      Public Sub Rotate(ByVal angle As Double)

      gp = CType(gpBase.Clone(), GraphicsPath)

      Dim mTransform As Matrix = New Matrix()

      mTransform.RotateAt(CType(angle,Single),NewPointF(midX,midY))

      gp.Transform(mTransform)

      End Sub

      End Class

      為了節(jié)省篇幅,上面的代碼省略了引入命名空間的語句。

      下面是分針(MinuteHand)類的定義:

      Public Class MinuteHand

      Inherits Hand

      ‘構(gòu)造器,生成繪制分針的路徑(gp)

      Public Sub New(ByVal myForm As Form1)

      MyBase.New(myForm)

      gp.AddLine(midX, midY, midX, 45)

      gp.AddLine(midX, 45, midX - 3, 50)

      gp.AddLine(midX - 3, 50, midX + 3, 50)

      gp.AddLine(midX + 3, 50, midX, 45)

      gpBase = CType(gp.Clone(), GraphicsPath)

      End Sub

      ‘Transform方法取得系統(tǒng)當(dāng)前時(shí)間,并旋轉(zhuǎn)時(shí)鐘指針。

      Public Overrides Sub Transform(ByVal d As DateTime)

      Dim minuteTime As Double = (CDbl(d.Minute) + CDbl(d.Second / 60))

      Dim angle As Double = (CDbl(minuteTime) / 60) * 360

      Rotate(angle)

      End Sub

      End Class

      對(duì)所有的指針旋轉(zhuǎn)的方法都是相同的,因此在基類中實(shí)現(xiàn)。由于時(shí)針和秒針的實(shí)現(xiàn)與分針相似,所不同者,只在于構(gòu)造器中繪制的指針路徑不同和Transform方法中轉(zhuǎn)動(dòng)的角度不同,在這里就不在贅述了。

      另外還需要提一下的是畫時(shí)鐘表面的代碼,時(shí)鐘表面用ClockFace類來實(shí)現(xiàn)。這個(gè)類首先畫一個(gè)圓代表時(shí)鐘,然后畫上米老鼠的圖案,最后在相應(yīng)的位置畫上數(shù)字1~12代表12個(gè)小時(shí)。

      Public Sub Draw(ByVal g As Graphics)

      DrawClockFace(g)

      DrawImage(g)

      DrawNumbers(g)

      DrawPin(g)

      End Sub

      下面是ClockFace類的屬性:

      Private ClockRectangle As Rectangle

      Private ClockFont As Font = New Font("Arial", 12)

      Private midPoint As Point

      Private ClockImage As Bitmap

      Private Const IMAGEX As Integer = 50

      Private Const IMAGEY As Integer = 50

      DrawClockFace方法用來畫時(shí)鐘表面:

      Private Sub DrawClockFace(ByVal g As Graphics)

      g.FillEllipse(Brushes.White, ClockRectangle.Left + 10, ClockRectangle.Top + 10, ClockRectangle.Width - 20, ClockRectangle.Height - 20)

      g.DrawEllipse(Pens.Black, ClockRectangle.Left + 10, ClockRectangle.Top + 10, ClockRectangle.Width - 20, ClockRectangle.Height - 20)

      End Sub

      然后用Graphics對(duì)象的DrawImage方法畫出米老鼠的圖片:

      Private Sub DrawImage(ByVal g As Graphics)

      Dim nWidth As Integer = ClockImage.Width

      Dim nHeight As Integer = ClockImage.Height

      Dim destRect As Rectangle = New Rectangle(midPoint.X - IMAGEX / 2, midPoint.Y - IMAGEY / 2, IMAGEX, IMAGEY)

      g.DrawImage(ClockImage, destRect)

      End Sub

      數(shù)字在時(shí)鐘上的位置是用sin和cos函數(shù)計(jì)算的:

      Private Sub DrawNumbers(ByVal g As Graphics)

      Dim count As Integer = 1

      Dim a As Double

      For a = 0 To 2 * Math.PI Step 2 * Math.PI / 12

      Dim x As Double = (ClockRectangle.Width - 70) / 2 * Math.Cos(a - Math.PI / 3) + (ClockRectangle.Width - 70) / 2 + 25

      Dim y As Double = (ClockRectangle.Width - 70) / 2 * Math.Sin(a - Math.PI / 3) + (ClockRectangle.Width - 70) / 2 + 20

      g.DrawString(Convert.ToString(count), ClockFont, Brushes.Black, CType(x, Single), CType(y, Single), New StringFormat())

      count += 1

      Next

      End Sub

      最后是窗體文件(Form1.vb):

      Public Class Form1

      Inherits System.Windows.Forms.Form

      Private MyMinuteHand As MinuteHand

      Private MyHourHand As HourHand

      Private MySecondHand As SecondHand

      Private TheClockFace As ClockFace

      Private FirstTick As Boolean = False

      ‘在窗體的OnPaint事件中取得Graphics對(duì)象

      Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)

      If (FirstTick = False) Then Exit Sub

      Dim g As Graphics = e.Graphics

      TheClockFace.Draw(g)

      MyHourHand.Draw(g)

      MyMinuteHand.Draw(g)

      MySecondHand.Draw(g)

      TheClockFace.DrawPin(g)

      End Sub

      ‘計(jì)時(shí)器事件

      Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick

      MySecondHand.Transform(DateTime.Now)

      MyHourHand.Transform(DateTime.Now)

      MyMinuteHand.Transform(DateTime.Now)

      FirstTick = True

      Invalidate()


      當(dāng)前文章:關(guān)于vb.net儀表盤源碼的信息
      地址分享:http://www.ef60e0e.cn/article/hipidj.html
      99热在线精品一区二区三区_国产伦精品一区二区三区女破破_亚洲一区二区三区无码_精品国产欧美日韩另类一区
      1. <ul id="0c1fb"></ul>

        <noscript id="0c1fb"><video id="0c1fb"></video></noscript>
        <noscript id="0c1fb"><listing id="0c1fb"><thead id="0c1fb"></thead></listing></noscript>

        屏边| 瑞安市| 岳西县| 淮北市| 石狮市| 江孜县| 拉萨市| 台东市| 青阳县| 始兴县| 阿克| 滁州市| 吕梁市| 恩平市| 永川市| 余江县| 清镇市| 宁陕县| 公安县| 茌平县| 遂川县| 将乐县| 孝昌县| 德江县| 贞丰县| 鄂温| 大荔县| 裕民县| 广宗县| 蒲城县| 南溪县| 洛浦县| 漳平市| 亚东县| 梧州市| 名山县| 夏河县| 肇东市| 新乐市| 含山县| 泰顺县|