|
-
Feb 20th, 2007, 08:22 AM
#1
[2005] Thumbnails
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.
VB 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
I want to show the image as Thumbnail
Dana
Please mark you thread resolved using the Thread Tools as shown
-
Feb 20th, 2007, 11:52 AM
#2
Re: [2005] Thumbnails
You could create a new bitmap at the size you need, and then draw the image onto it. This question has been asked several times before, if you would search for "create thumbnails" or something to that extent. There is even an example in the codebank if you look there.
-
Feb 20th, 2007, 12:41 PM
#3
Re: [2005] Thumbnails
Search the forums (vb.net and vb.net codebank) for MrPolite's threads on thumbnails. He has done allot in this area.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|