OSDN Git Service

FixedImageブランチをマージ
authorsyo68k <syo68k@users.sourceforge.jp>
Mon, 27 Sep 2010 10:09:06 +0000 (10:09 +0000)
committerKimura Youichi <kim.upsilon@bucyou.net>
Sat, 18 Feb 2012 14:15:36 +0000 (23:15 +0900)
git-svn-id: http://svn.sourceforge.jp/svnroot/tween/trunk@911 e39ad16e-3079-482e-bb30-4b4d378143b6

Tween/Connection/HttpVarious.vb

index 8ac1bce..dc0bd28 100644 (file)
@@ -158,33 +158,15 @@ Public Class HttpVarious
     Public Overloads Function CheckValidImage(ByVal img As Image, ByVal width As Integer, ByVal height As Integer) As Image
         If img Is Nothing Then Return Nothing
 
-        If img.RawFormat.Guid = Imaging.ImageFormat.Gif.Guid Then
-            Dim fd As New System.Drawing.Imaging.FrameDimension(img.FrameDimensionsList(0))
-            Dim fd_count As Integer = img.GetFrameCount(fd)
-            If fd_count > 1 Then
-                Try
-                    For i As Integer = 0 To fd_count - 1
-                        img.SelectActiveFrame(fd, i)
-                    Next
-                    Return img
-                Catch ex As Exception
-                    '不正な画像の場合は、bitmapに書き直し
-                    Dim bmp As New Bitmap(width, height)
-                    Dim tag As Object = img.Tag
-                    Using g As Graphics = Graphics.FromImage(bmp)
-                        g.InterpolationMode = Drawing2D.InterpolationMode.High
-                        g.DrawImage(img, 0, 0, width, height)
-                    End Using
-                    img.Dispose()
-                    bmp.Tag = tag
-                    Return bmp
-                End Try
-            Else
-                Return img
-            End If
-        Else
-            Return img
-        End If
+        Dim bmp As New Bitmap(width, height)
+        Dim tag As Object = img.Tag
+        Using g As Graphics = Graphics.FromImage(bmp)
+            g.InterpolationMode = Drawing2D.InterpolationMode.High
+            g.DrawImage(img, 0, 0, width, height)
+        End Using
+        img.Dispose()
+        bmp.Tag = tag
+        Return bmp
     End Function
 
 End Class