Image Transparency Problem in Access Report

F

Fred Rush

I have created an MS Access report and have overlayed a
transparent .gif image on top of another image. The image
seems to lose it's transparency in the report. I have
confirmed that the "Back Style" property of the image is
set to transparent. Any ideas would be greatly appreciated.
 
S

Stephen Lebans

I honestly do not know if transparency wil be preserved when you overlay
two images. Give this solution a try:
http://www.lebans.com/transparent.htm
Transparent.zip is a database containing functions to allow for the
conversion of Bitmap, Gif, Jpeg, Enhanced Metafile and Metafile to an
Enhanced Metafile format supporting Transparent backgrounds.
Bug in A2K under Win98 or NT.

The issue is with Access and how it it is rendering the metafile. As
someone mentioned you can load the converted files that do not display
properly in Access, into other Office apps where they display fine.

If you look closely you will see that Access is grabbing the current
display memory as background for the Image control before it paints the
metafile. That's what you are seeing as background noise in the
converted Transparent images.
In the versions of Access and Win OS's where the Images display
normally, the current display memory of the Form is masked out as the
Metafile is rendered. This is how I am able to achieve transparency with
Access.
For some internal Access issue, A2K is not masking the background
properly on Win98 and NT. It works fine on Win2K.

Preliminary experimentation shows that a plain old Metafile, not the
Enhanced Metafiles I am using now, seems to work on all versions of
Windows with all version of Access. I will test further and release a
new version.
In the meantime here is a quick fix.

1) Load and convert the desired Image using my Transparent functions.
Save the converted Image to disk as you would normally. DO not worry
that the background contains "garbage".
2) Open Microsoft WOrd. Menu-_Insert->Picture->From File
Browse to your converted Image you previously saved and select it.
3) After the Image appears on the page Click once on the Image to select
it.
4) Right click and select Copy from the Popup menu or click on the
ToolBar to select COPY
5) Open an Access Form and Select Paste from the Menu or ToolBar. The
Image is pasted as an unbound OLE frame.
6) On the Access Form-Format menu select Change To->Image control.
7) Change the new converted Image control's Back Style Prop to
Transparent.
--

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

Guest

Stephen Lebans said:
I honestly do not know if transparency wil be preserved when you overlay
two images. Give this solution a try:
http://www.lebans.com/transparent.htm
Transparent.zip is a database containing functions to allow for the
conversion of Bitmap, Gif, Jpeg, Enhanced Metafile and Metafile to an
Enhanced Metafile format supporting Transparent backgrounds.
Bug in A2K under Win98 or NT.

The issue is with Access and how it it is rendering the metafile. As
someone mentioned you can load the converted files that do not display
properly in Access, into other Office apps where they display fine.

If you look closely you will see that Access is grabbing the current
display memory as background for the Image control before it paints the
metafile. That's what you are seeing as background noise in the
converted Transparent images.
In the versions of Access and Win OS's where the Images display
normally, the current display memory of the Form is masked out as the
Metafile is rendered. This is how I am able to achieve transparency with
Access.
For some internal Access issue, A2K is not masking the background
properly on Win98 and NT. It works fine on Win2K.

Preliminary experimentation shows that a plain old Metafile, not the
Enhanced Metafiles I am using now, seems to work on all versions of
Windows with all version of Access. I will test further and release a
new version.
In the meantime here is a quick fix.

1) Load and convert the desired Image using my Transparent functions.
Save the converted Image to disk as you would normally. DO not worry
that the background contains "garbage".
2) Open Microsoft WOrd. Menu-_Insert->Picture->From File
Browse to your converted Image you previously saved and select it.
3) After the Image appears on the page Click once on the Image to select
it.
4) Right click and select Copy from the Popup menu or click on the
ToolBar to select COPY
5) Open an Access Form and Select Paste from the Menu or ToolBar. The
Image is pasted as an unbound OLE frame.
6) On the Access Form-Format menu select Change To->Image control.
7) Change the new converted Image control's Back Style Prop to
Transparent.
--

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

Guest

Thanks, Stephen. That worked great! Basically, the code in the Access db in
the .zip file was a utility that converted the transparent .gif to an Ehanced
Metafile (.emf) image. Apparantly that type of image retains it's
transparency in an Access report. I actually came accross that article when
trying to solve this before I posted this, but didn't think it applied to
this situation.

Thanks again!
 

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