OpenTweenのfork
修訂 | cabf2fad51326e69adb1318a1198f3a85ac8833b (tree) |
---|---|
時間 | 2012-02-18 23:12:05 |
作者 | syo68k <syo68k@user...> |
Commiter | Kimura Youichi |
ユーザー情報ダイアログでユーザーアイコンを読み込んで表示するようにした
git-svn-id: http://svn.sourceforge.jp/svnroot/tween/trunk@261 e39ad16e-3079-482e-bb30-4b4d378143b6
@@ -48,6 +48,10 @@ Partial Class ShowUserInfo | ||
48 | 48 | Me.LabelIsProtected = New System.Windows.Forms.Label() |
49 | 49 | Me.LabelIsFollowing = New System.Windows.Forms.Label() |
50 | 50 | 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() | |
51 | 55 | Me.SuspendLayout() |
52 | 56 | ' |
53 | 57 | 'ButtonClose |
@@ -188,10 +192,26 @@ Partial Class ShowUserInfo | ||
188 | 192 | resources.ApplyResources(Me.LabelIsFollowed, "LabelIsFollowed") |
189 | 193 | Me.LabelIsFollowed.Name = "LabelIsFollowed" |
190 | 194 | ' |
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 | + ' | |
191 | 209 | 'ShowUserInfo |
192 | 210 | ' |
193 | 211 | resources.ApplyResources(Me, "$this") |
194 | 212 | Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font |
213 | + Me.Controls.Add(Me.LabelScreenName) | |
214 | + Me.Controls.Add(Me.UserPicture) | |
195 | 215 | Me.Controls.Add(Me.LabelIsFollowed) |
196 | 216 | Me.Controls.Add(Me.LabelIsFollowing) |
197 | 217 | Me.Controls.Add(Me.LabelIsProtected) |
@@ -223,6 +243,7 @@ Partial Class ShowUserInfo | ||
223 | 243 | Me.Name = "ShowUserInfo" |
224 | 244 | Me.ShowIcon = False |
225 | 245 | Me.TopMost = True |
246 | + CType(Me.UserPicture, System.ComponentModel.ISupportInitialize).EndInit() | |
226 | 247 | Me.ResumeLayout(False) |
227 | 248 | Me.PerformLayout() |
228 | 249 |
@@ -252,4 +273,7 @@ Partial Class ShowUserInfo | ||
252 | 273 | Friend WithEvents LabelIsProtected As System.Windows.Forms.Label |
253 | 274 | Friend WithEvents LabelIsFollowing As System.Windows.Forms.Label |
254 | 275 | 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 | |
255 | 279 | End Class |
@@ -27,6 +27,7 @@ Public Class ShowUserInfo | ||
27 | 27 | |
28 | 28 | Private userInfoXml As String = "" |
29 | 29 | Private _info As UserInfo |
30 | + Private icondata As Image = Nothing | |
30 | 31 | |
31 | 32 | Private Structure UserInfo |
32 | 33 | Dim Name As String |
@@ -78,8 +79,13 @@ Public Class ShowUserInfo | ||
78 | 79 | Me.Close() |
79 | 80 | Return |
80 | 81 | Else |
82 | + 'アイコンロード | |
83 | + BackgroundWorker1.RunWorkerAsync() | |
84 | + | |
81 | 85 | Me.Text = Me.Text.Insert(0, _info.ScreenName + " ") |
86 | + LabelScreenName.Text = _info.ScreenName | |
82 | 87 | LabelName.Text = _info.Name |
88 | + | |
83 | 89 | LabelLocation.Text = _info.Location |
84 | 90 | LinkLabelWeb.Text = _info.Url |
85 | 91 |
@@ -173,4 +179,36 @@ Public Class ShowUserInfo | ||
173 | 179 | MessageBox.Show(My.Resources.FRMessage3) |
174 | 180 | End If |
175 | 181 | 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 | |
176 | 214 | End Class |
\ No newline at end of file |