By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,815 Members | 1,143 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,815 IT Pros & Developers. It's quick & easy.

displaying product pictures from database

P: n/a
Thanks All,
I have a vb.net desktop application form from which a user chooses a
product code from a database (Access97) using a comboBox. Each record
of the database has a field giving the address of the .jpg file
associated (e.g. Item #7925354 has a .jpg in folder
F:/productPicures/7925354). I need to programmatically display the .jpg
when the user chooses a product. Obviously I don't want the actual .jpg
to be stored in the database to avoid bloat, that's why the record has
only a path. Any clues? Thanks! Brian
BTW: Here's the code I used when I did all this in Access97 (VB6.0):
Private Sub Form_Current()
On Error Resume Next
Me![ImageFrame].Picture = Me!Picture
'gets picture corresponding to item number
End Sub

Nov 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
ca***************@yahoo.com wrote:
Thanks All,
I have a vb.net desktop application form from which a user chooses a
product code from a database (Access97) using a comboBox. Each record
of the database has a field giving the address of the .jpg file
associated (e.g. Item #7925354 has a .jpg in folder
F:/productPicures/7925354). I need to programmatically display the .jpg
when the user chooses a product. Obviously I don't want the actual .jpg
to be stored in the database to avoid bloat, that's why the record has
only a path. Any clues? Thanks! Brian
BTW: Here's the code I used when I did all this in Access97 (VB6.0):
Private Sub Form_Current()
On Error Resume Next
Me![ImageFrame].Picture = Me!Picture
'gets picture corresponding to item number
End Sub


Am I missing something or can't you just use a picture box?

PictureBox.Image = Image.FromFile(Path)

Chris
Nov 21 '05 #2

P: n/a
<ca***************@yahoo.com> schrieb:
I have a vb.net desktop application form from which a user chooses a
product code from a database (Access97) using a comboBox. Each record
of the database has a field giving the address of the .jpg file
associated (e.g. Item #7925354 has a .jpg in folder
F:/productPicures/7925354). I need to programmatically display the .jpg
when the user chooses a product. Obviously I don't want the actual .jpg
to be stored in the database to avoid bloat, that's why the record has
only a path.


\\\
Private m_CurrentPicture As Image
..
..
..
Private Sub DisplayRecordData(...)
If Not m_CurrentPicture Is Nothing Then
Me.PictureBoxProductPicture.Picture = Nothing
m_CurrentPicture.Dispose()
End If
m_CurrentPicture = Image.FromFile(...)
Me.PictureBoxProductPicture.Picture = m_CurrentPicture
End Sub
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.