• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

OpenTweenのfork


Commit MetaInfo

修訂cabf2fad51326e69adb1318a1198f3a85ac8833b (tree)
時間2012-02-18 23:12:05
作者syo68k <syo68k@user...>
CommiterKimura Youichi

Log Message

ユーザー情報ダイアログでユーザーアイコンを読み込んで表示するようにした

git-svn-id: http://svn.sourceforge.jp/svnroot/tween/trunk@261 e39ad16e-3079-482e-bb30-4b4d378143b6

Change Summary

差異

--- a/Tween/ShowUserInfo.Designer.vb
+++ b/Tween/ShowUserInfo.Designer.vb
@@ -48,6 +48,10 @@ Partial Class ShowUserInfo
4848 Me.LabelIsProtected = New System.Windows.Forms.Label()
4949 Me.LabelIsFollowing = New System.Windows.Forms.Label()
5050 Me.LabelIsFollowed = New System.Windows.Forms.Label()
51+ Me.UserPicture = New System.Windows.Forms.PictureBox()
52+ Me.LabelScreenName = New System.Windows.Forms.Label()
53+ Me.BackgroundWorker1 = New System.ComponentModel.BackgroundWorker()
54+ CType(Me.UserPicture, System.ComponentModel.ISupportInitialize).BeginInit()
5155 Me.SuspendLayout()
5256 '
5357 'ButtonClose
@@ -188,10 +192,26 @@ Partial Class ShowUserInfo
188192 resources.ApplyResources(Me.LabelIsFollowed, "LabelIsFollowed")
189193 Me.LabelIsFollowed.Name = "LabelIsFollowed"
190194 '
195+ 'UserPicture
196+ '
197+ resources.ApplyResources(Me.UserPicture, "UserPicture")
198+ Me.UserPicture.Name = "UserPicture"
199+ Me.UserPicture.TabStop = False
200+ '
201+ 'LabelScreenName
202+ '
203+ resources.ApplyResources(Me.LabelScreenName, "LabelScreenName")
204+ Me.LabelScreenName.Name = "LabelScreenName"
205+ '
206+ 'BackgroundWorker1
207+ '
208+ '
191209 'ShowUserInfo
192210 '
193211 resources.ApplyResources(Me, "$this")
194212 Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
213+ Me.Controls.Add(Me.LabelScreenName)
214+ Me.Controls.Add(Me.UserPicture)
195215 Me.Controls.Add(Me.LabelIsFollowed)
196216 Me.Controls.Add(Me.LabelIsFollowing)
197217 Me.Controls.Add(Me.LabelIsProtected)
@@ -223,6 +243,7 @@ Partial Class ShowUserInfo
223243 Me.Name = "ShowUserInfo"
224244 Me.ShowIcon = False
225245 Me.TopMost = True
246+ CType(Me.UserPicture, System.ComponentModel.ISupportInitialize).EndInit()
226247 Me.ResumeLayout(False)
227248 Me.PerformLayout()
228249
@@ -252,4 +273,7 @@ Partial Class ShowUserInfo
252273 Friend WithEvents LabelIsProtected As System.Windows.Forms.Label
253274 Friend WithEvents LabelIsFollowing As System.Windows.Forms.Label
254275 Friend WithEvents LabelIsFollowed As System.Windows.Forms.Label
276+ Friend WithEvents UserPicture As System.Windows.Forms.PictureBox
277+ Friend WithEvents LabelScreenName As System.Windows.Forms.Label
278+ Friend WithEvents BackgroundWorker1 As System.ComponentModel.BackgroundWorker
255279 End Class
--- a/Tween/ShowUserInfo.vb
+++ b/Tween/ShowUserInfo.vb
@@ -27,6 +27,7 @@ Public Class ShowUserInfo
2727
2828 Private userInfoXml As String = ""
2929 Private _info As UserInfo
30+ Private icondata As Image = Nothing
3031
3132 Private Structure UserInfo
3233 Dim Name As String
@@ -78,8 +79,13 @@ Public Class ShowUserInfo
7879 Me.Close()
7980 Return
8081 Else
82+ 'アイコンロード
83+ BackgroundWorker1.RunWorkerAsync()
84+
8185 Me.Text = Me.Text.Insert(0, _info.ScreenName + " ")
86+ LabelScreenName.Text = _info.ScreenName
8287 LabelName.Text = _info.Name
88+
8389 LabelLocation.Text = _info.Location
8490 LinkLabelWeb.Text = _info.Url
8591
@@ -173,4 +179,36 @@ Public Class ShowUserInfo
173179 MessageBox.Show(My.Resources.FRMessage3)
174180 End If
175181 End Sub
182+
183+ Private Sub ShowUserInfo_Activated(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Activated
184+ '画面が他画面の裏に隠れると、アイコン画像が再描画されない問題の対応
185+ If UserPicture.Image IsNot Nothing Then
186+ UserPicture.Invalidate(False)
187+ End If
188+ End Sub
189+
190+ Private Sub ShowUserInfo_FormClosing(ByVal sender As System.Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles MyBase.FormClosing
191+ UserPicture.Image = Nothing
192+ If icondata IsNot Nothing Then
193+ icondata.Dispose()
194+ End If
195+ End Sub
196+
197+ Private Sub BackgroundWorker1_DoWork(ByVal sender As System.Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles BackgroundWorker1.DoWork
198+ Try
199+ icondata = (New HttpVarious).GetImage(_info.ImageUrl.ToString())
200+ Catch ex As Exception
201+ icondata = Nothing
202+ End Try
203+ End Sub
204+
205+ Private Sub BackgroundWorker1_RunWorkerCompleted(ByVal sender As System.Object, ByVal e As System.ComponentModel.RunWorkerCompletedEventArgs) Handles BackgroundWorker1.RunWorkerCompleted
206+ Try
207+ If icondata IsNot Nothing Then
208+ UserPicture.Image = icondata
209+ End If
210+ Catch ex As Exception
211+ UserPicture.Image = Nothing
212+ End Try
213+ End Sub
176214 End Class
\ No newline at end of file