タイトル : Re^5: VBでフォトアルバムを作りたい>< 投稿日 : 2010/12/08(Wed) 09:52 投稿者 : shu
Image.FromFileについて http://dobon.net/vb/dotnet/graphics/imagefromfile.html サンプルです: Public Class 〜 Private m_files() as string Private m_intFileIdx as integer Private m_img as Image = nothing Private Sub cmdRefFolder_Click(sender 〜) handles cmdRefFolder.click m_files = System.IO.Directory.GetFiles(〜) m_intFileIdx = 0 End Sub Private Sub cmdView_Click(sender 〜) Handles cmdView.Click Dim img as Image = Image.FromFile(m_files(m_intFileIdx)) PictureBox1.Image = img m_intFileIdx += 1 if m_intFileIdx >= m_files.length then m_intFileIdx = 0 if m_img isnot nothing then m_img.Dispose End If m_img = img End Sub Private Sub Me_Disposed(ByVal sender 〜) Handles Me.Disposed if m_img isnot nothing then m_img.Dispose End If End Sub End Class |