image inflate problem

R

rmanchu

all the posts i've read, states the OLE field inflates image files
i use NO OLE field

using SQL Server 2000 - IMAGE field
using Access 2003

i use simple code to select a jpeg file and display it in a an access
form Image control.
then another button

Me.Recordset.Fields(0).Value = Me.myImage.PictureData

when the record is updated the image is saved.however, the saved image
has been inflated many times. can this be solved?

thanx
riyaz
 
S

Stephen Lebans

Because the image is converted to an uncompressed Bitmap and stored as
either a packed DIB in CF_BITMAP format or the DIB is wrapped in a Metafile
in CF_ENHMETAFILE format.

You could store a copy of the compressed Image file as binary data. When
you want to display it then safe the field to disk as a temp file with the
proper file extension and then load that into the Picture property of the
Image control. If you are into GDI programming, you can bypass the temp file
method and unpack the compressed Image directly in memory and build the
PictureData property yourself.
--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top