Public Class FileOperations Private newImage As Bitmap Public Function OpenFile() As Bitmap Dim ofd As New OpenFileDialog With { .InitialDirectory = "C:\Images", .Filter = "images| *.jpg; *.png; *.bmp" } If ofd.ShowDialog() = DialogResult.OK Then newImage = New Bitmap(Image.FromFile(ofd.FileName)) End If Return newImage End Function End Class