View Single Post
  #8 (permalink)  
Old January 10th, 2012, 07:58 PM
Rod Stephens's Avatar
Rod Stephens Rod Stephens is offline
Wrox Author
Points: 3,166, Level: 23
Points: 3,166, Level: 23 Points: 3,166, Level: 23 Points: 3,166, Level: 23
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Jan 2006
Location: , , .
Posts: 647
Thanks: 2
Thanked 96 Times in 95 Posts

Hi Gary,

bm_source is a Bitmap holding the image you want to resize. I think you could load it from a file as in:

Dim bm_source As New Bitmap(filename)
Where filename is the file's name. It could be an absolute path including the drive letter and everything, or it could be just the file's name if it's in the same directory as the executing program.

You could use a dialog box something like this:

' Show the Open Dialog Box.
If ofdSelectPicture.ShowDialog() = DialogResult.OK Then
    ' Load the picture into the bitmap.
    Dim bm_source As New Bitmap(ofdSelectPicture.FileName)

    ' Resize the bitmap.

    ' Display the result.
    picResized.Image = bm_dest
End If

Rod Stephens, Microsoft MVP

Essential Algorithms: A Practical Approach to Computer Algorithms

(Please post reviews at Amazon or wherever you shop!)
Reply With Quote