How to Insert Thumbnails on Form

  • Thread starter Thread starter Amit D.Shinde
  • Start date Start date
A

Amit D.Shinde

I am Using VB.Net 2002
I want to Insert Thumbnails of Image files like .bmp, .jpg etc
in my form
How can I do it?
 
Amit D.Shinde said:
I am Using VB.Net 2002
I want to Insert Thumbnails of Image files like .bmp, .jpg etc
in my form
How can I do it?

Call Image.FromFile, or pass the file name to the constructor of a bitmap.
To create thumbnails you can use the DrawImage method of a graphics object.
 
Amit D.Shinde said:
I am Using VB.Net 2002
I want to Insert Thumbnails of Image files like .bmp, .jpg etc
in my form

Have a look at the 'Image.GetThumbnailImage' method.

If you want to be able to specify interpolation mode:

\\\
Dim bmp As New Bitmap( _
"C:\Lagoon1024x768.bmp" _
)
Dim bmp2 As New Bitmap( _
bmp.Width * 0.1, _
bmp.Height * 0.1, _
Imaging.PixelFormat.Format24bppRgb _
)
Dim g As Graphics = Graphics.FromImage(bmp2)

' Select/change interpolation mode here.
g.InterpolationMode = _
Drawing.Drawing2D.InterpolationMode.HighQualityBicubic

' Draw image using specified interpolation mode.
g.DrawImage(bmp, 0, 0, bmp2.Width, bmp2.Height)
g.Dispose()

Me.PictureBox1.Image = bmp2
bmp2.Save("C:\foo.bmp")
..
..
..
///
 
Back
Top