From 1ccec1b0d62d8abe03bc27be27d8ae54d48e339f Mon Sep 17 00:00:00 2001 From: syo68k Date: Mon, 27 Sep 2010 10:09:06 +0000 Subject: [PATCH] =?utf8?q?FixedImage=E3=83=96=E3=83=A9=E3=83=B3=E3=83=81?= =?utf8?q?=E3=82=92=E3=83=9E=E3=83=BC=E3=82=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit git-svn-id: http://svn.sourceforge.jp/svnroot/tween/trunk@911 e39ad16e-3079-482e-bb30-4b4d378143b6 --- Tween/Connection/HttpVarious.vb | 36 +++++++++--------------------------- 1 file changed, 9 insertions(+), 27 deletions(-) diff --git a/Tween/Connection/HttpVarious.vb b/Tween/Connection/HttpVarious.vb index 8ac1bce6..dc0bd281 100644 --- a/Tween/Connection/HttpVarious.vb +++ b/Tween/Connection/HttpVarious.vb @@ -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 -- 2.11.0