Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bound Picture control in VB3: can't display picture from .MDB file

0 views
Skip to first unread message

Bob Dengler

unread,
Aug 23, 1996, 3:00:00 AM8/23/96
to

I have an MS Access 2.0 database that has a picture field with small (200x150
pixel) images. I want to display these on a VB3 form using the picture
control, but I get an "invalid picture" error every time I use the data control
on the form to move to a record in the database that has a picture entry (not
all records have a picture). I assume that since the picture control can be
bound to a data control, this should be possible.

Any suggestions?

Bob


Joe Foster

unread,
Aug 23, 1996, 3:00:00 AM8/23/96
to

> Any suggestions?

> Bob

VB and Access store images very differently. Unless there's a way
to bind OLE controls to database long binary fields in VB 4,
you'll have to use the method given in the KB for extracting the
image from the OLE data, saving the image to a temporary disk
file, and using LoadPicture to display the image. The KB is at
<http://www.microsoft.com/kb> and some keywords to use are:
LoadPicture FieldSize GetChunk Open Put Close.

--
Joe Foster (j...@bftsi0.gate.net or joe%bft...@uunet.uu.net)
WARNING: I cannot be held responsible for the above They're coming to
because my cats have apparently learned to type. take me away, ha ha!

Jack Berlin

unread,
Aug 23, 1996, 3:00:00 AM8/23/96
to no...@no6b.jpl.nasa.gov

Bob Dengler wrote:
>
> I have an MS Access 2.0 database that has a picture field with small (200x150
> pixel) images. I want to display these on a VB3 form using the picture
> control, but I get an "invalid picture" error every time I use the data control
> on the form to move to a record in the database that has a picture entry (not
> all records have a picture). I assume that since the picture control can be
> bound to a data control, this should be possible.
>
> Any suggestions?
>
> Bob


Bob:
Imagine software has VBX, OCX, Access, Fox, Clarion, C, etc. graphics
handling tools which are fast and include other features like palette
control, rotation, printing and zooming. ($395)
http://www.imagn.com/
regards,
jack
--
********************************************************************
Jack Berlin - 813-875-7575 x303 FAX 813-875-7705 jbe...@jpg.com
http://www.jpg.com/ - Pegasus Imaging Corp - the BETTER JPEG people!
********************************************************************

Bob Dengler

unread,
Aug 23, 1996, 3:00:00 AM8/23/96
to

In <321DD4...@jpg.com>, Jack Berlin <jbe...@jpg.com> writes:
>Bob Dengler wrote:
>>
>> I have an MS Access 2.0 database that has a picture field with small (200x150
>> pixel) images. I want to display these on a VB3 form using the picture
>> control, but I get an "invalid picture" error every time I use the data control
>> on the form to move to a record in the database that has a picture entry (not
>> all records have a picture). I assume that since the picture control can be
>> bound to a data control, this should be possible.
>>
>> Any suggestions?
>>
>> Bob
>
>
>Bob:
>Imagine software has VBX, OCX, Access, Fox, Clarion, C, etc. graphics
>handling tools which are fast and include other features like palette
>control, rotation, printing and zooming. ($395)
> http://www.imagn.com/
>regards,
>jack

Thanks for the info, Jack, but I think $400 is a bit much for a picture box
VBX. The entire VB3 Pro package cost less than that :)

I've found the Microsoft KB article (q103115) that discusses my problem. MS
claims that the bound picture box can display bitmaps stored in OLE fields in
the Access database. The problem is displaying Paintbrush OLE objects. I
double-checked my DB & found that my objects are listed at 'picture'. I do
have a couple of 'Paintbrush picture' objects stored in the field, & those
display correctly by using the sample code in q103115, but the 'picture'
objects do not display, which seems to reenforce my assertion that they are in
fact bitmaps & should display in the bound picture box.

The plot thickens.

Bob


Bob Dengler

unread,
Aug 23, 1996, 3:00:00 AM8/23/96
to

It appears that this problem is bidirectional. If I load a bitmap into a bound
picture control & try to update the database by clicking the data control, I
get an "Out of memory" error. For what it's worth, the bitmap I'm trying to
put into the database is 250x150 pixels, B/W, with 58 MB of memory & 67% of
system resources available. I really don't think I'm out of memory.

Bob


Jack Berlin

unread,
Aug 27, 1996, 3:00:00 AM8/27/96
to no...@no6b.jpl.nasa.gov


Sorry, I was answering a question and did not think about the cost. It
does seem to me that the timed saved in this process of having a
solution (which I do not know) would have been worth quite a lot?
I just have found that most graphics packages are from people who bundle
software, not understand graphics; explaining the speed and quality
problems. Mike at Imagine has done a super job and I personally think
he sells his stuff too cheap for the support (there is a concept) he
gives.
Best of luck,

0 new messages