OSDN Git Service

アイコン取得失敗しても、ImageUrlを残すように(次回取得できる可能性あり)
authorkiri_feather <kiri_feather@users.sourceforge.jp>
Mon, 6 Sep 2010 15:19:38 +0000 (15:19 +0000)
committerKimura Youichi <kim.upsilon@bucyou.net>
Sat, 18 Feb 2012 14:15:12 +0000 (23:15 +0900)
git-svn-id: http://svn.sourceforge.jp/svnroot/tween/trunk@811 e39ad16e-3079-482e-bb30-4b4d378143b6

Tween/Tween.vb
Tween/Twitter.vb

index 35c36d7..379d97d 100644 (file)
@@ -3828,7 +3828,9 @@ Public Class TweenMain
                             x += columns.Width
                         End If
                     Next
-                    e.Graphics.DrawImage(tw.DetailIcon(e.Item.ImageKey), New Rectangle(x, e.Bounds.Top, Math.Min(_iconSz, e.Bounds.Width), _iconSz))
+                    If tw.DetailIcon.ContainsKey(e.Item.ImageKey) Then
+                        e.Graphics.DrawImage(tw.DetailIcon(e.Item.ImageKey), New Rectangle(x, e.Bounds.Top, Math.Min(_iconSz, e.Bounds.Width), _iconSz))
+                    End If
                 End If
             End If
         End If
index 3c14847..3e717d7 100644 (file)
@@ -249,7 +249,7 @@ Public Class Twitter
             Dim httpVar As New HttpVarious
             img = httpVar.GetImage(post.ImageUrl, 10000)
             If img Is Nothing Then
-                post.ImageUrl = Nothing
+                'post.ImageUrl = Nothing
                 TabInformations.GetInstance.AddPost(post)
                 Exit Sub
             End If
@@ -262,13 +262,13 @@ Public Class Twitter
                         _dIcon.Add(post.ImageUrl, img)
                     Catch ex As InvalidOperationException
                         'タイミングにより追加できない場合がある?(キー重複ではない)
-                        post.ImageUrl = Nothing
+                        'post.ImageUrl = Nothing
                     Catch ex As System.OverflowException
                         '不正なアイコン?DrawImageに失敗する場合あり
-                        post.ImageUrl = Nothing
+                        'post.ImageUrl = Nothing
                     Catch ex As OutOfMemoryException
                         'DrawImageで発生
-                        post.ImageUrl = Nothing
+                        'post.ImageUrl = Nothing
                     End Try
                 End If
             End SyncLock