Image control bmp display problem

B

BarbaraC

I am having trouble with an image control! I have the
code working fine to display a different photo for each
record based upon the path and file name stored in the
database. However, if I try to display a JPG file it
looks fine, but a BMP file appears to be displaying with
only 256 colors instead of 24 bit. I would really like to
use BMP files (since that is what the user is already
using). What could the problem be?


I originally tried using a bound object frame and set OLE
Type Allowed property to "Linked", however my database
grew enormously so it appears that the files were actually
being embedded??? However I had no problem displaying the
BMP files via the bound object frame! The code I used for
this was....


Sub InsertPicture_Click()
[Photo].OLETypeAllowed=acOLELinked
[Photo].SourceDoc = Browse(Me) --- user picks file
[Photo].Action=acOLECreateLink
[Photo].SizeMode=acOLESizeStretch
End Sub

I don't really care which way I have to do it... just so
the files are not embedded and I can use BMP files!
Thanks for any help!
 
B

Bill Stanton

Barbara,
I use "image controls" frequently with dynamically
determined paths inserted into the controls "Picture"
property. The other key properties are "Linked" and
Zoom. Since the image is linked, the rendering code
is excluded and your front-end does not grow out of
control. I use both bmp and jpg files without any
perceptible difference in either color or impacts on
front-end size.

I tried to use OLE controls way back when, but ran
into so much trouble with much the same mysteries
that you seem to be encountering. Perhaps I've not
accurately interpreted what the problem is that you're
having, but it seems to fit some of the historical
problems I had in the past.

Bill
 
L

Larry Linson

There is an article included with the sample databases at
http://accdevel.tripod.com (illustrating three approaches to handling images
in Access) that explains the bloat associated with using OLE Objects and
Bound OLE Frames.

No, it is not storing the linked file. Even worse, it is "helping you out"
by creating a thumbnail which it is storing (in bitmap format -- so the
thumbnail view is [usually|always] larger than a compressed, e.g., JPG or
GIF, image file that you tried to save space by linking). No, there is no
way to control or turn off this behavior.

I have had no particular problems with using Image controls -- there are
"graphics filters" that must be installed for the Image control to support
certain files like JPG, but that would not cause a deterioration of display
of BMP.

Larry Linson
Microsoft Access MVP
 
J

Jamie

If you have the image control's size mode property set to "Zoom" try
changing it to "Clip" and see if that makes a difference.

Jamie
 
G

Guest

Thanks! That did work, however how do I control the size
of the image now if it's set to "clip"? These are
photographs taken from a microscope and I have no idea of
the size. I want to display them in a fairly small area
(about 2" x 2"). Since the size mode is set to "clip"
only part of the photo is showing.

-----Original Message-----
If you have the image control's size mode property set to "Zoom" try
changing it to "Clip" and see if that makes a difference.

Jamie

I am having trouble with an image control! I have the
code working fine to display a different photo for each
record based upon the path and file name stored in the
database. However, if I try to display a JPG file it
looks fine, but a BMP file appears to be displaying with
only 256 colors instead of 24 bit. I would really like to
use BMP files (since that is what the user is already
using). What could the problem be?


I originally tried using a bound object frame and set OLE
Type Allowed property to "Linked", however my database
grew enormously so it appears that the files were actually
being embedded??? However I had no problem displaying the
BMP files via the bound object frame! The code I used for
this was....


Sub InsertPicture_Click()
[Photo].OLETypeAllowed=acOLELinked
[Photo].SourceDoc = Browse(Me) --- user picks file
[Photo].Action=acOLECreateLink
[Photo].SizeMode=acOLESizeStretch
End Sub

I don't really care which way I have to do it... just so
the files are not embedded and I can use BMP files!
Thanks for any help!


.
 
G

Guest

Forgot to ask... why does changing it to "Clip" for a BMP
file in an image control make a difference, but a JPG file
displayed with no problem when I had it set to "Stretch"?

And when I tried using a bound object frame the BMP files
diplayed just fine when set to "Stretch"???

-----Original Message-----
If you have the image control's size mode property set to "Zoom" try
changing it to "Clip" and see if that makes a difference.

Jamie

I am having trouble with an image control! I have the
code working fine to display a different photo for each
record based upon the path and file name stored in the
database. However, if I try to display a JPG file it
looks fine, but a BMP file appears to be displaying with
only 256 colors instead of 24 bit. I would really like to
use BMP files (since that is what the user is already
using). What could the problem be?


I originally tried using a bound object frame and set OLE
Type Allowed property to "Linked", however my database
grew enormously so it appears that the files were actually
being embedded??? However I had no problem displaying the
BMP files via the bound object frame! The code I used for
this was....


Sub InsertPicture_Click()
[Photo].OLETypeAllowed=acOLELinked
[Photo].SourceDoc = Browse(Me) --- user picks file
[Photo].Action=acOLECreateLink
[Photo].SizeMode=acOLESizeStretch
End Sub

I don't really care which way I have to do it... just so
the files are not embedded and I can use BMP files!
Thanks for any help!


.
 
J

Jamie

I had this problem a while ago the image is not displayed in 256 colours -
it is actually just distorted. I don't know why this happens - only that it
does and only that bitmap files displayed in standard image controls are
affected It only appears on some systems, therefore I assume it is a
graphics driver issue as I found that changing the driver would sometimes
(but not always) resolve it. Another (not very elegant) workaround I found
was to resize the image control itself at runtime so that it was larger than
the actual image being displayed and then to resize the image control back
to the size I wished to display the image at which corrects the distortion
in the majority instances (code below) If this sounds too complex then you
could have the image open full size in a pop-up form or alternatively use
Application.FollowHyperlink [Path-to-Image] to have it open up with the
default bitmap application by clicking a button.

I'd also be interested if anyone else has anymore info or experience with
this issue.

Jamie

Check the file extension first - if it is a bmp file and the image control's
size mode property is set to "Zoom"
then call fixBitmap and pass the name of your image control to the function.
'---------------------------------------------------------------------------
------------
' Procedure : fixBitmap
' DateTime : 18/06/2003
' Purpose : During testing found that some bmp images would appear
distorted when the
' size mode was either zoom or stretch.
' Was unable to find a reason for this however through trial and
error, I
' discovered that resizing the image control to twice the size
of the
' image and then restoring the image control to normal cleared
this
' distortion.
'---------------------------------------------------------------------------
------------
Public Function fixBitmap(ImgCtrl As Access.Control) As Boolean

Dim lngHeight As Long
Dim lngWidth As Long

On Error GoTo fixBitmap_Error

With ImgCtrl
lngHeight = .Height
lngWidth = .Width
.Visible = False
.Width = .ImageHeight * 2
.Height = .ImageWidth * 2
.Height = lngHeight
.Width = lngWidth
.Visible = True
End With
Set ImgCtrl = Nothing
fixBitmap = True

On Error GoTo 0
Exit Function

fixBitmap_Error:
'error so restore image control to normal:
ImgCtrl.Height = lngHeight
ImgCtrl.Width = lngWidth
ImgCtrl.Visible = True

End Function

Thanks! That did work, however how do I control the size
of the image now if it's set to "clip"? These are
photographs taken from a microscope and I have no idea of
the size. I want to display them in a fairly small area
(about 2" x 2"). Since the size mode is set to "clip"
only part of the photo is showing.

-----Original Message-----
If you have the image control's size mode property set to "Zoom" try
changing it to "Clip" and see if that makes a difference.

Jamie

I am having trouble with an image control! I have the
code working fine to display a different photo for each
record based upon the path and file name stored in the
database. However, if I try to display a JPG file it
looks fine, but a BMP file appears to be displaying with
only 256 colors instead of 24 bit. I would really like to
use BMP files (since that is what the user is already
using). What could the problem be?


I originally tried using a bound object frame and set OLE
Type Allowed property to "Linked", however my database
grew enormously so it appears that the files were actually
being embedded??? However I had no problem displaying the
BMP files via the bound object frame! The code I used for
this was....


Sub InsertPicture_Click()
[Photo].OLETypeAllowed=acOLELinked
[Photo].SourceDoc = Browse(Me) --- user picks file
[Photo].Action=acOLECreateLink
[Photo].SizeMode=acOLESizeStretch
End Sub

I don't really care which way I have to do it... just so
the files are not embedded and I can use BMP files!
Thanks for any help!


.
 
B

BarbaraC

I really appreciate your help. I am waiting to hear back
from my users to see if they are willing to switch to JPG
files (which would solve my problem)! I hate to change
what the users are doing - would prefer to solve the
problem, but I have a deadline and can't seem to find the
right solution with the BMP files! Thank you again!
-----Original Message-----
I had this problem a while ago the image is not displayed in 256 colours -
it is actually just distorted. I don't know why this happens - only that it
does and only that bitmap files displayed in standard image controls are
affected It only appears on some systems, therefore I assume it is a
graphics driver issue as I found that changing the driver would sometimes
(but not always) resolve it. Another (not very elegant) workaround I found
was to resize the image control itself at runtime so that it was larger than
the actual image being displayed and then to resize the image control back
to the size I wished to display the image at which corrects the distortion
in the majority instances (code below) If this sounds too complex then you
could have the image open full size in a pop-up form or alternatively use
Application.FollowHyperlink [Path-to-Image] to have it open up with the
default bitmap application by clicking a button.

I'd also be interested if anyone else has anymore info or experience with
this issue.

Jamie

Check the file extension first - if it is a bmp file and the image control's
size mode property is set to "Zoom"
then call fixBitmap and pass the name of your image control to the function.
'--------------------------------------------------------- ------------------
------------
' Procedure : fixBitmap
' DateTime : 18/06/2003
' Purpose : During testing found that some bmp images would appear
distorted when the
' size mode was either zoom or stretch.
' Was unable to find a reason for this however through trial and
error, I
' discovered that resizing the image control to twice the size
of the
' image and then restoring the image control to normal cleared
this
' distortion.
'--------------------------------------------------------- ------------------
------------
Public Function fixBitmap(ImgCtrl As Access.Control) As Boolean

Dim lngHeight As Long
Dim lngWidth As Long

On Error GoTo fixBitmap_Error

With ImgCtrl
lngHeight = .Height
lngWidth = .Width
.Visible = False
.Width = .ImageHeight * 2
.Height = .ImageWidth * 2
.Height = lngHeight
.Width = lngWidth
.Visible = True
End With
Set ImgCtrl = Nothing
fixBitmap = True

On Error GoTo 0
Exit Function

fixBitmap_Error:
'error so restore image control to normal:
ImgCtrl.Height = lngHeight
ImgCtrl.Width = lngWidth
ImgCtrl.Visible = True

End Function

Thanks! That did work, however how do I control the size
of the image now if it's set to "clip"? These are
photographs taken from a microscope and I have no idea of
the size. I want to display them in a fairly small area
(about 2" x 2"). Since the size mode is set to "clip"
only part of the photo is showing.

-----Original Message-----
If you have the image control's size mode property set to "Zoom" try
changing it to "Clip" and see if that makes a difference.

Jamie

"BarbaraC" <[email protected]> wrote
in
message
I am having trouble with an image control! I have the
code working fine to display a different photo for each
record based upon the path and file name stored in the
database. However, if I try to display a JPG file it
looks fine, but a BMP file appears to be displaying with
only 256 colors instead of 24 bit. I would really
like
to
use BMP files (since that is what the user is already
using). What could the problem be?


I originally tried using a bound object frame and set OLE
Type Allowed property to "Linked", however my database
grew enormously so it appears that the files were actually
being embedded??? However I had no problem
displaying
the
BMP files via the bound object frame! The code I
used
for
this was....


Sub InsertPicture_Click()
[Photo].OLETypeAllowed=acOLELinked
[Photo].SourceDoc = Browse(Me) --- user picks file
[Photo].Action=acOLECreateLink
[Photo].SizeMode=acOLESizeStretch
End Sub

I don't really care which way I have to do it... just so
the files are not embedded and I can use BMP files!
Thanks for any help!




.


.
 
B

BarbaraC

I am trying your fixBitmap solution right now, but keep
encountering an error. I stuck some debugging code in
your function and here's what happened. The Height and
Width of my control are 1560 and 2304. The image Height
and Width are 9000 and 12,000. I am getting the
error "Error 2100 The control or subform control is too
large for this location." I thought the boundaries of my
form might have been too small so I enlarge it quite a bit
and still keep getting the error. Any suggestions?


-----Original Message-----
I had this problem a while ago the image is not displayed in 256 colours -
it is actually just distorted. I don't know why this happens - only that it
does and only that bitmap files displayed in standard image controls are
affected It only appears on some systems, therefore I assume it is a
graphics driver issue as I found that changing the driver would sometimes
(but not always) resolve it. Another (not very elegant) workaround I found
was to resize the image control itself at runtime so that it was larger than
the actual image being displayed and then to resize the image control back
to the size I wished to display the image at which corrects the distortion
in the majority instances (code below) If this sounds too complex then you
could have the image open full size in a pop-up form or alternatively use
Application.FollowHyperlink [Path-to-Image] to have it open up with the
default bitmap application by clicking a button.

I'd also be interested if anyone else has anymore info or experience with
this issue.

Jamie

Check the file extension first - if it is a bmp file and the image control's
size mode property is set to "Zoom"
then call fixBitmap and pass the name of your image control to the function.
'--------------------------------------------------------- ------------------
------------
' Procedure : fixBitmap
' DateTime : 18/06/2003
' Purpose : During testing found that some bmp images would appear
distorted when the
' size mode was either zoom or stretch.
' Was unable to find a reason for this however through trial and
error, I
' discovered that resizing the image control to twice the size
of the
' image and then restoring the image control to normal cleared
this
' distortion.
'--------------------------------------------------------- ------------------
------------
Public Function fixBitmap(ImgCtrl As Access.Control) As Boolean

Dim lngHeight As Long
Dim lngWidth As Long

On Error GoTo fixBitmap_Error

With ImgCtrl
lngHeight = .Height
lngWidth = .Width
.Visible = False
.Width = .ImageHeight * 2
.Height = .ImageWidth * 2
.Height = lngHeight
.Width = lngWidth
.Visible = True
End With
Set ImgCtrl = Nothing
fixBitmap = True

On Error GoTo 0
Exit Function

fixBitmap_Error:
'error so restore image control to normal:
ImgCtrl.Height = lngHeight
ImgCtrl.Width = lngWidth
ImgCtrl.Visible = True

End Function

Thanks! That did work, however how do I control the size
of the image now if it's set to "clip"? These are
photographs taken from a microscope and I have no idea of
the size. I want to display them in a fairly small area
(about 2" x 2"). Since the size mode is set to "clip"
only part of the photo is showing.

-----Original Message-----
If you have the image control's size mode property set to "Zoom" try
changing it to "Clip" and see if that makes a difference.

Jamie

"BarbaraC" <[email protected]> wrote
in
message
I am having trouble with an image control! I have the
code working fine to display a different photo for each
record based upon the path and file name stored in the
database. However, if I try to display a JPG file it
looks fine, but a BMP file appears to be displaying with
only 256 colors instead of 24 bit. I would really
like
to
use BMP files (since that is what the user is already
using). What could the problem be?


I originally tried using a bound object frame and set OLE
Type Allowed property to "Linked", however my database
grew enormously so it appears that the files were actually
being embedded??? However I had no problem
displaying
the
BMP files via the bound object frame! The code I
used
for
this was....


Sub InsertPicture_Click()
[Photo].OLETypeAllowed=acOLELinked
[Photo].SourceDoc = Browse(Me) --- user picks file
[Photo].Action=acOLECreateLink
[Photo].SizeMode=acOLESizeStretch
End Sub

I don't really care which way I have to do it... just so
the files are not embedded and I can use BMP files!
Thanks for any help!




.


.
 
J

Jamie

As the images are large you might be exceeding the form height or width -
you could try moving the control's Top and Left to 0 and then restoring them
again as I did with the Height and Width or reducing the multiplying factor
to less than 2 although that might not work - it's trial and error really.


BarbaraC said:
I am trying your fixBitmap solution right now, but keep
encountering an error. I stuck some debugging code in
your function and here's what happened. The Height and
Width of my control are 1560 and 2304. The image Height
and Width are 9000 and 12,000. I am getting the
error "Error 2100 The control or subform control is too
large for this location." I thought the boundaries of my
form might have been too small so I enlarge it quite a bit
and still keep getting the error. Any suggestions?


-----Original Message-----
I had this problem a while ago the image is not displayed in 256 colours -
it is actually just distorted. I don't know why this happens - only that it
does and only that bitmap files displayed in standard image controls are
affected It only appears on some systems, therefore I assume it is a
graphics driver issue as I found that changing the driver would sometimes
(but not always) resolve it. Another (not very elegant) workaround I found
was to resize the image control itself at runtime so that it was larger than
the actual image being displayed and then to resize the image control back
to the size I wished to display the image at which corrects the distortion
in the majority instances (code below) If this sounds too complex then you
could have the image open full size in a pop-up form or alternatively use
Application.FollowHyperlink [Path-to-Image] to have it open up with the
default bitmap application by clicking a button.

I'd also be interested if anyone else has anymore info or experience with
this issue.

Jamie

Check the file extension first - if it is a bmp file and the image control's
size mode property is set to "Zoom"
then call fixBitmap and pass the name of your image control to the function.
'--------------------------------------------------------- ------------------
------------
' Procedure : fixBitmap
' DateTime : 18/06/2003
' Purpose : During testing found that some bmp images would appear
distorted when the
' size mode was either zoom or stretch.
' Was unable to find a reason for this however through trial and
error, I
' discovered that resizing the image control to twice the size
of the
' image and then restoring the image control to normal cleared
this
' distortion.
'--------------------------------------------------------- ------------------
------------
Public Function fixBitmap(ImgCtrl As Access.Control) As Boolean

Dim lngHeight As Long
Dim lngWidth As Long

On Error GoTo fixBitmap_Error

With ImgCtrl
lngHeight = .Height
lngWidth = .Width
.Visible = False
.Width = .ImageHeight * 2
.Height = .ImageWidth * 2
.Height = lngHeight
.Width = lngWidth
.Visible = True
End With
Set ImgCtrl = Nothing
fixBitmap = True

On Error GoTo 0
Exit Function

fixBitmap_Error:
'error so restore image control to normal:
ImgCtrl.Height = lngHeight
ImgCtrl.Width = lngWidth
ImgCtrl.Visible = True

End Function

Thanks! That did work, however how do I control the size
of the image now if it's set to "clip"? These are
photographs taken from a microscope and I have no idea of
the size. I want to display them in a fairly small area
(about 2" x 2"). Since the size mode is set to "clip"
only part of the photo is showing.


-----Original Message-----
If you have the image control's size mode property set
to "Zoom" try
changing it to "Clip" and see if that makes a difference.

Jamie

message
I am having trouble with an image control! I have the
code working fine to display a different photo for each
record based upon the path and file name stored in the
database. However, if I try to display a JPG file it
looks fine, but a BMP file appears to be displaying with
only 256 colors instead of 24 bit. I would really like
to
use BMP files (since that is what the user is already
using). What could the problem be?


I originally tried using a bound object frame and set
OLE
Type Allowed property to "Linked", however my database
grew enormously so it appears that the files were
actually
being embedded??? However I had no problem displaying
the
BMP files via the bound object frame! The code I used
for
this was....


Sub InsertPicture_Click()
[Photo].OLETypeAllowed=acOLELinked
[Photo].SourceDoc = Browse(Me) --- user picks file
[Photo].Action=acOLECreateLink
[Photo].SizeMode=acOLESizeStretch
End Sub

I don't really care which way I have to do it... just so
the files are not embedded and I can use BMP files!
Thanks for any help!




.


.
 
B

BarbaraC

I actually tried all of those suggestions and was able to
bypass the error, however it did not change the appearance
of the picture. I have been using 4 sample files on my
laptop that were originally JPG files. I opened them in
Paint and saved them as BMP files. I have now tried a
different file (photograph that I saved via Adobe as BMP)
and it appears not to have the same problem (any idea
why?). So - I might be OK. I will have to check the
actual files in my office when I go in tomorrow. Thanks
for your help!

-----Original Message-----
As the images are large you might be exceeding the form height or width -
you could try moving the control's Top and Left to 0 and then restoring them
again as I did with the Height and Width or reducing the multiplying factor
to less than 2 although that might not work - it's trial and error really.


BarbaraC said:
I am trying your fixBitmap solution right now, but keep
encountering an error. I stuck some debugging code in
your function and here's what happened. The Height and
Width of my control are 1560 and 2304. The image Height
and Width are 9000 and 12,000. I am getting the
error "Error 2100 The control or subform control is too
large for this location." I thought the boundaries of my
form might have been too small so I enlarge it quite a bit
and still keep getting the error. Any suggestions?


-----Original Message-----
I had this problem a while ago the image is not
displayed
in 256 colours -
it is actually just distorted. I don't know why this happens - only that it
does and only that bitmap files displayed in standard image controls are
affected It only appears on some systems, therefore I assume it is a
graphics driver issue as I found that changing the
driver
would sometimes
(but not always) resolve it. Another (not very elegant) workaround I found
was to resize the image control itself at runtime so
that
it was larger than
the actual image being displayed and then to resize the image control back
to the size I wished to display the image at which corrects the distortion
in the majority instances (code below) If this sounds
too
complex then you
could have the image open full size in a pop-up form or alternatively use
Application.FollowHyperlink [Path-to-Image] to have it open up with the
default bitmap application by clicking a button.

I'd also be interested if anyone else has anymore info
or
experience with
this issue.

Jamie

Check the file extension first - if it is a bmp file
and
the image control's
size mode property is set to "Zoom"
then call fixBitmap and pass the name of your image control to the function.
'------------------------------------------------------
---
------------------
------------
' Procedure : fixBitmap
' DateTime : 18/06/2003
' Purpose : During testing found that some bmp images would appear
distorted when the
' size mode was either zoom or stretch.
' Was unable to find a reason for this however through trial and
error, I
' discovered that resizing the image
control
to twice the size
of the
' image and then restoring the image
control
to normal cleared
this
' distortion.
'------------------------------------------------------
---
------------------
------------
Public Function fixBitmap(ImgCtrl As Access.Control) As Boolean

Dim lngHeight As Long
Dim lngWidth As Long

On Error GoTo fixBitmap_Error

With ImgCtrl
lngHeight = .Height
lngWidth = .Width
.Visible = False
.Width = .ImageHeight * 2
.Height = .ImageWidth * 2
.Height = lngHeight
.Width = lngWidth
.Visible = True
End With
Set ImgCtrl = Nothing
fixBitmap = True

On Error GoTo 0
Exit Function

fixBitmap_Error:
'error so restore image control to normal:
ImgCtrl.Height = lngHeight
ImgCtrl.Width = lngWidth
ImgCtrl.Visible = True

End Function

Thanks! That did work, however how do I control the size
of the image now if it's set to "clip"? These are
photographs taken from a microscope and I have no
idea
of
the size. I want to display them in a fairly small area
(about 2" x 2"). Since the size mode is set to "clip"
only part of the photo is showing.


-----Original Message-----
If you have the image control's size mode property set
to "Zoom" try
changing it to "Clip" and see if that makes a difference.

Jamie

"BarbaraC" <[email protected]>
wrote
in
message
I am having trouble with an image control! I have the
code working fine to display a different photo for each
record based upon the path and file name stored in the
database. However, if I try to display a JPG file it
looks fine, but a BMP file appears to be
displaying
with
only 256 colors instead of 24 bit. I would really like
to
use BMP files (since that is what the user is already
using). What could the problem be?


I originally tried using a bound object frame and set
OLE
Type Allowed property to "Linked", however my database
grew enormously so it appears that the files were
actually
being embedded??? However I had no problem displaying
the
BMP files via the bound object frame! The code I used
for
this was....


Sub InsertPicture_Click()
[Photo].OLETypeAllowed=acOLELinked
[Photo].SourceDoc = Browse(Me) --- user picks file
[Photo].Action=acOLECreateLink
[Photo].SizeMode=acOLESizeStretch
End Sub

I don't really care which way I have to do it... just so
the files are not embedded and I can use BMP files!
Thanks for any help!




.



.


.
 
S

Stephen Lebans

Possibbly one of the 3 following solutions will solve your issue:

1) Take moment to read the Image FAQ here:
http://www.lebans.com/image_faq.htm

2) This solution bypasses the Office Graphics filters
http://www.lebans.com/loadjpeggif.htm
A97LoadJpegGif.zip is a database containing a function to allow for the
Display of Jpeg and Gif files on systems that do not have the Office
Graphic Filters installed. Here is the A2K version: A2KLoadJpegGif.zip

NEW - April 05 2003 Ver 5.0 Developed to allow Access RunTime
installations to display Jpeg files in a standard Image Control.
Provides functionality to load JPG,GIF,BMP,EMF,WMF,CUR and ICO files on
systems without the Office Graphics Filters loaded.
Originally developed for Systems with Access Runtime only. Supports
transparency in Transparent Gifs. Allows you to resize Images on
Forms/Reports at runtime with no loss of Image quality.

3) ACC2000: Device Independent Bitmaps (DIBs) Not Visible in Microsoft
Access
http://support.microsoft.com/default.aspx?scid=kb;en-us;262437&Product=a
cc2000
--

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


BarbaraC said:
I actually tried all of those suggestions and was able to
bypass the error, however it did not change the appearance
of the picture. I have been using 4 sample files on my
laptop that were originally JPG files. I opened them in
Paint and saved them as BMP files. I have now tried a
different file (photograph that I saved via Adobe as BMP)
and it appears not to have the same problem (any idea
why?). So - I might be OK. I will have to check the
actual files in my office when I go in tomorrow. Thanks
for your help!

-----Original Message-----
As the images are large you might be exceeding the form height or width -
you could try moving the control's Top and Left to 0 and then restoring them
again as I did with the Height and Width or reducing the multiplying factor
to less than 2 although that might not work - it's trial and error really.


BarbaraC said:
I am trying your fixBitmap solution right now, but keep
encountering an error. I stuck some debugging code in
your function and here's what happened. The Height and
Width of my control are 1560 and 2304. The image Height
and Width are 9000 and 12,000. I am getting the
error "Error 2100 The control or subform control is too
large for this location." I thought the boundaries of my
form might have been too small so I enlarge it quite a bit
and still keep getting the error. Any suggestions?



-----Original Message-----
I had this problem a while ago the image is not displayed
in 256 colours -
it is actually just distorted. I don't know why this
happens - only that it
does and only that bitmap files displayed in standard
image controls are
affected It only appears on some systems, therefore I
assume it is a
graphics driver issue as I found that changing the driver
would sometimes
(but not always) resolve it. Another (not very elegant)
workaround I found
was to resize the image control itself at runtime so that
it was larger than
the actual image being displayed and then to resize the
image control back
to the size I wished to display the image at which
corrects the distortion
in the majority instances (code below) If this sounds too
complex then you
could have the image open full size in a pop-up form or
alternatively use
Application.FollowHyperlink [Path-to-Image] to have it
open up with the
default bitmap application by clicking a button.

I'd also be interested if anyone else has anymore info or
experience with
this issue.

Jamie

Check the file extension first - if it is a bmp file and
the image control's
size mode property is set to "Zoom"
then call fixBitmap and pass the name of your image
control to the function.
'------------------------------------------------------ ---
------------------
------------
' Procedure : fixBitmap
' DateTime : 18/06/2003
' Purpose : During testing found that some bmp images
would appear
distorted when the
' size mode was either zoom or stretch.
' Was unable to find a reason for this
however through trial and
error, I
' discovered that resizing the image control
to twice the size
of the
' image and then restoring the image control
to normal cleared
this
' distortion.
'------------------------------------------------------ ---
------------------
------------
Public Function fixBitmap(ImgCtrl As Access.Control) As
Boolean

Dim lngHeight As Long
Dim lngWidth As Long

On Error GoTo fixBitmap_Error

With ImgCtrl
lngHeight = .Height
lngWidth = .Width
.Visible = False
.Width = .ImageHeight * 2
.Height = .ImageWidth * 2
.Height = lngHeight
.Width = lngWidth
.Visible = True
End With
Set ImgCtrl = Nothing
fixBitmap = True

On Error GoTo 0
Exit Function

fixBitmap_Error:
'error so restore image control to normal:
ImgCtrl.Height = lngHeight
ImgCtrl.Width = lngWidth
ImgCtrl.Visible = True

End Function

Thanks! That did work, however how do I control the
size
of the image now if it's set to "clip"? These are
photographs taken from a microscope and I have no idea
of
the size. I want to display them in a fairly small area
(about 2" x 2"). Since the size mode is set to "clip"
only part of the photo is showing.


-----Original Message-----
If you have the image control's size mode property set
to "Zoom" try
changing it to "Clip" and see if that makes a
difference.

Jamie

in
message
I am having trouble with an image control! I have
the
code working fine to display a different photo for
each
record based upon the path and file name stored in
the
database. However, if I try to display a JPG file it
looks fine, but a BMP file appears to be displaying
with
only 256 colors instead of 24 bit. I would really
like
to
use BMP files (since that is what the user is already
using). What could the problem be?


I originally tried using a bound object frame and set
OLE
Type Allowed property to "Linked", however my
database
grew enormously so it appears that the files were
actually
being embedded??? However I had no problem
displaying
the
BMP files via the bound object frame! The code I
used
for
this was....


Sub InsertPicture_Click()
[Photo].OLETypeAllowed=acOLELinked
[Photo].SourceDoc = Browse(Me) --- user picks
file
[Photo].Action=acOLECreateLink
[Photo].SizeMode=acOLESizeStretch
End Sub

I don't really care which way I have to do it...
just so
the files are not embedded and I can use BMP files!
Thanks for any help!




.



.


.
 
J

Jamie

Hi Stephen,

After reading the following on you site:

' Uppercase BMP = Office Graphics filter - Normal results
' Lowercase bmp = bypass Office Graphics filters - Poor results for BMP's
containing full color bitmaps

I tried this with the images that had been distorted on some PCs and they
seem to be displaying fine now.

Thanks - now I can remove the image control resizing code and just convert
the file extension to BMP instead of bmp. MS should really document this in
their knowledge base site. Barbara - I'm interested to know if this fixes
things for you also.

Jamie

Stephen Lebans said:
Possibbly one of the 3 following solutions will solve your issue:

1) Take moment to read the Image FAQ here:
http://www.lebans.com/image_faq.htm

2) This solution bypasses the Office Graphics filters
http://www.lebans.com/loadjpeggif.htm
A97LoadJpegGif.zip is a database containing a function to allow for the
Display of Jpeg and Gif files on systems that do not have the Office
Graphic Filters installed. Here is the A2K version: A2KLoadJpegGif.zip

NEW - April 05 2003 Ver 5.0 Developed to allow Access RunTime
installations to display Jpeg files in a standard Image Control.
Provides functionality to load JPG,GIF,BMP,EMF,WMF,CUR and ICO files on
systems without the Office Graphics Filters loaded.
Originally developed for Systems with Access Runtime only. Supports
transparency in Transparent Gifs. Allows you to resize Images on
Forms/Reports at runtime with no loss of Image quality.

3) ACC2000: Device Independent Bitmaps (DIBs) Not Visible in Microsoft
Access
http://support.microsoft.com/default.aspx?scid=kb;en-us;262437&Product=a
cc2000
--

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


BarbaraC said:
I actually tried all of those suggestions and was able to
bypass the error, however it did not change the appearance
of the picture. I have been using 4 sample files on my
laptop that were originally JPG files. I opened them in
Paint and saved them as BMP files. I have now tried a
different file (photograph that I saved via Adobe as BMP)
and it appears not to have the same problem (any idea
why?). So - I might be OK. I will have to check the
actual files in my office when I go in tomorrow. Thanks
for your help!

-----Original Message-----
As the images are large you might be exceeding the form height or width -
you could try moving the control's Top and Left to 0 and then restoring them
again as I did with the Height and Width or reducing the multiplying factor
to less than 2 although that might not work - it's trial and error really.


I am trying your fixBitmap solution right now, but keep
encountering an error. I stuck some debugging code in
your function and here's what happened. The Height and
Width of my control are 1560 and 2304. The image Height
and Width are 9000 and 12,000. I am getting the
error "Error 2100 The control or subform control is too
large for this location." I thought the boundaries of my
form might have been too small so I enlarge it quite a bit
and still keep getting the error. Any suggestions?



-----Original Message-----
I had this problem a while ago the image is not displayed
in 256 colours -
it is actually just distorted. I don't know why this
happens - only that it
does and only that bitmap files displayed in standard
image controls are
affected It only appears on some systems, therefore I
assume it is a
graphics driver issue as I found that changing the driver
would sometimes
(but not always) resolve it. Another (not very elegant)
workaround I found
was to resize the image control itself at runtime so that
it was larger than
the actual image being displayed and then to resize the
image control back
to the size I wished to display the image at which
corrects the distortion
in the majority instances (code below) If this sounds too
complex then you
could have the image open full size in a pop-up form or
alternatively use
Application.FollowHyperlink [Path-to-Image] to have it
open up with the
default bitmap application by clicking a button.

I'd also be interested if anyone else has anymore info or
experience with
this issue.

Jamie

Check the file extension first - if it is a bmp file and
the image control's
size mode property is set to "Zoom"
then call fixBitmap and pass the name of your image
control to the function.
'------------------------------------------------------ ---
------------------
------------
' Procedure : fixBitmap
' DateTime : 18/06/2003
' Purpose : During testing found that some bmp images
would appear
distorted when the
' size mode was either zoom or stretch.
' Was unable to find a reason for this
however through trial and
error, I
' discovered that resizing the image control
to twice the size
of the
' image and then restoring the image control
to normal cleared
this
' distortion.
'------------------------------------------------------ ---
------------------
------------
Public Function fixBitmap(ImgCtrl As Access.Control) As
Boolean

Dim lngHeight As Long
Dim lngWidth As Long

On Error GoTo fixBitmap_Error

With ImgCtrl
lngHeight = .Height
lngWidth = .Width
.Visible = False
.Width = .ImageHeight * 2
.Height = .ImageWidth * 2
.Height = lngHeight
.Width = lngWidth
.Visible = True
End With
Set ImgCtrl = Nothing
fixBitmap = True

On Error GoTo 0
Exit Function

fixBitmap_Error:
'error so restore image control to normal:
ImgCtrl.Height = lngHeight
ImgCtrl.Width = lngWidth
ImgCtrl.Visible = True

End Function

Thanks! That did work, however how do I control the
size
of the image now if it's set to "clip"? These are
photographs taken from a microscope and I have no idea
of
the size. I want to display them in a fairly small area
(about 2" x 2"). Since the size mode is set to "clip"
only part of the photo is showing.


-----Original Message-----
If you have the image control's size mode property set
to "Zoom" try
changing it to "Clip" and see if that makes a
difference.

Jamie

in
message
I am having trouble with an image control! I have
the
code working fine to display a different photo for
each
record based upon the path and file name stored in
the
database. However, if I try to display a JPG file it
looks fine, but a BMP file appears to be displaying
with
only 256 colors instead of 24 bit. I would really
like
to
use BMP files (since that is what the user is already
using). What could the problem be?


I originally tried using a bound object frame and set
OLE
Type Allowed property to "Linked", however my
database
grew enormously so it appears that the files were
actually
being embedded??? However I had no problem
displaying
the
BMP files via the bound object frame! The code I
used
for
this was....


Sub InsertPicture_Click()
[Photo].OLETypeAllowed=acOLELinked
[Photo].SourceDoc = Browse(Me) --- user picks
file
[Photo].Action=acOLECreateLink
[Photo].SizeMode=acOLESizeStretch
End Sub

I don't really care which way I have to do it...
just so
the files are not embedded and I can use BMP files!
Thanks for any help!




.



.



.
 
B

BarbaraC

IT WORKED! I renamed the bitmap file extensions to BMP
instead of bmp and now they display correctly. I would
never have figured that out (or guessed it could work) in
a million years! I really appreciate everyone's help
with this problem!

-----Original Message-----
Possibbly one of the 3 following solutions will solve your issue:

1) Take moment to read the Image FAQ here:
http://www.lebans.com/image_faq.htm

2) This solution bypasses the Office Graphics filters
http://www.lebans.com/loadjpeggif.htm
A97LoadJpegGif.zip is a database containing a function to allow for the
Display of Jpeg and Gif files on systems that do not have the Office
Graphic Filters installed. Here is the A2K version: A2KLoadJpegGif.zip

NEW - April 05 2003 Ver 5.0 Developed to allow Access RunTime
installations to display Jpeg files in a standard Image Control.
Provides functionality to load JPG,GIF,BMP,EMF,WMF,CUR and ICO files on
systems without the Office Graphics Filters loaded.
Originally developed for Systems with Access Runtime only. Supports
transparency in Transparent Gifs. Allows you to resize Images on
Forms/Reports at runtime with no loss of Image quality.

3) ACC2000: Device Independent Bitmaps (DIBs) Not Visible in Microsoft
Access
http://support.microsoft.com/default.aspx?scid=kb;en- us;262437&Product=a
cc2000
--

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


BarbaraC said:
I actually tried all of those suggestions and was able to
bypass the error, however it did not change the appearance
of the picture. I have been using 4 sample files on my
laptop that were originally JPG files. I opened them in
Paint and saved them as BMP files. I have now tried a
different file (photograph that I saved via Adobe as BMP)
and it appears not to have the same problem (any idea
why?). So - I might be OK. I will have to check the
actual files in my office when I go in tomorrow. Thanks
for your help!

-----Original Message-----
As the images are large you might be exceeding the
form
height or width -
you could try moving the control's Top and Left to 0
and
then restoring them
again as I did with the Height and Width or reducing
the
multiplying factor
to less than 2 although that might not work - it's
trial
and error really.
I am trying your fixBitmap solution right now, but keep
encountering an error. I stuck some debugging code in
your function and here's what happened. The Height and
Width of my control are 1560 and 2304. The image Height
and Width are 9000 and 12,000. I am getting the
error "Error 2100 The control or subform control is too
large for this location." I thought the boundaries
of
my
form might have been too small so I enlarge it
quite a
bit
and still keep getting the error. Any suggestions?



-----Original Message-----
I had this problem a while ago the image is not displayed
in 256 colours -
it is actually just distorted. I don't know why this
happens - only that it
does and only that bitmap files displayed in standard
image controls are
affected It only appears on some systems, therefore I
assume it is a
graphics driver issue as I found that changing the driver
would sometimes
(but not always) resolve it. Another (not very elegant)
workaround I found
was to resize the image control itself at runtime
so
that
it was larger than
the actual image being displayed and then to resize the
image control back
to the size I wished to display the image at which
corrects the distortion
in the majority instances (code below) If this
sounds
too
complex then you
could have the image open full size in a pop-up form or
alternatively use
Application.FollowHyperlink [Path-to-Image] to have it
open up with the
default bitmap application by clicking a button.

I'd also be interested if anyone else has anymore
info
or
experience with
this issue.

Jamie

Check the file extension first - if it is a bmp
file
and
the image control's
size mode property is set to "Zoom"
then call fixBitmap and pass the name of your image
control to the function.
'--------------------------------------------------
----
---
------------------
------------
' Procedure : fixBitmap
' DateTime : 18/06/2003
' Purpose : During testing found that some bmp images
would appear
distorted when the
' size mode was either zoom or stretch.
' Was unable to find a reason for this
however through trial and
error, I
' discovered that resizing the image control
to twice the size
of the
' image and then restoring the image control
to normal cleared
this
' distortion.
'--------------------------------------------------
----
---
------------------
------------
Public Function fixBitmap(ImgCtrl As Access.Control) As
Boolean

Dim lngHeight As Long
Dim lngWidth As Long

On Error GoTo fixBitmap_Error

With ImgCtrl
lngHeight = .Height
lngWidth = .Width
.Visible = False
.Width = .ImageHeight * 2
.Height = .ImageWidth * 2
.Height = lngHeight
.Width = lngWidth
.Visible = True
End With
Set ImgCtrl = Nothing
fixBitmap = True

On Error GoTo 0
Exit Function

fixBitmap_Error:
'error so restore image control to normal:
ImgCtrl.Height = lngHeight
ImgCtrl.Width = lngWidth
ImgCtrl.Visible = True

End Function

Thanks! That did work, however how do I control the
size
of the image now if it's set to "clip"? These are
photographs taken from a microscope and I have no idea
of
the size. I want to display them in a fairly
small
area
(about 2" x 2"). Since the size mode is set to "clip"
only part of the photo is showing.


-----Original Message-----
If you have the image control's size mode
property
set
to "Zoom" try
changing it to "Clip" and see if that makes a
difference.

Jamie

in
message
I am having trouble with an image control! I have
the
code working fine to display a different photo for
each
record based upon the path and file name stored in
the
database. However, if I try to display a JPG file it
looks fine, but a BMP file appears to be displaying
with
only 256 colors instead of 24 bit. I would really
like
to
use BMP files (since that is what the user is already
using). What could the problem be?


I originally tried using a bound object frame
and
set
OLE
Type Allowed property to "Linked", however my
database
grew enormously so it appears that the files were
actually
being embedded??? However I had no problem
displaying
the
BMP files via the bound object frame! The code I
used
for
this was....


Sub InsertPicture_Click()
[Photo].OLETypeAllowed=acOLELinked
[Photo].SourceDoc = Browse(Me) --- user picks
file
[Photo].Action=acOLECreateLink
[Photo].SizeMode=acOLESizeStretch
End Sub

I don't really care which way I have to do it...
just so
the files are not embedded and I can use BMP files!
Thanks for any help!




.



.



.

.
 

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