Dear All,
How to show a image from the Database as a Thumbnails.I am using this code
to display the image from database.How to shrink the image to fit to the picturebox.
I want to show the image as ThumbnailVB Code:
Private Function ShowImageandDetailsFromDB(ByVal iErrorID As Long) Dim imagecmd As OleDbCommand = New OleDbCommand("Select Top 1 Error_Description,Error_Image from photos where Error_ID='" & iErrorID & "'", con) Dim imagereader As OleDbDataReader imagereader = imagecmd.ExecuteReader imagereader.Read() Dim b(imagereader.GetBytes(1, 0, Nothing, 0, Integer.MaxValue) - 1) As Byte imagereader.GetBytes(1, 0, b, 0, b.Length) imagereader.Close() Dim ms As New System.IO.MemoryStream(b) picError.Image = Image.FromStream(ms) 'PicError it the Picturebox End Function
Dana




Reply With Quote