none
PNG transparency is not preserved in Access Report, Print Preview RRS feed

  • Question

  • In Access Reports, you can set an Image's BackStyle to Transparent but it does NOT appear to be preserved in the Print Preview of a Report. It does however work in Design and Layout Views, but those are not finished products. There have been work-arounds posted including importing the PNG into Word, and then copying and pasting directly into an Access Report. While this is a clever trick and does seem to work, it does not cover the case where your images are inserted via VBA script in the Detail Section of a report. There appears to be no way to truly set the BackStyle as Transparent. <image>.BackStyle = 0 has no effect. How is this accomplished?
    Friday, December 22, 2017 6:26 PM

All replies

  • Hi,

    You may be misunderstanding what the BackStyle property means. I don't think it refers to the background of the image but of the control itself. For example, if you were using an Image Control and set the BackStyle property to Transparent, if you set the Picture Size Mode to Zoom and then enlarge the control bigger than the image inside it, you should see the extra space inside the control will not have a background color. This is more obvious, especially, if you have border turned on.

    I haven't verified it, so I could be wrong though.

    Cheers!




    • Edited by .theDBguy Friday, December 22, 2017 6:39 PM
    Friday, December 22, 2017 6:33 PM
  • Hello,

    As .theDBguy said, BackStyle is for the control instead of the picture.

    Could you please share us the screenshots of Print Preview and layout view? Could you please share a sample image here?

    Regards.

    Celeste


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, December 25, 2017 6:51 AM
    Moderator
  • I regret to say I still cannot post images or links. I have verified my email address twice now and Office Dev still will not let me post them. All you would see however is that the PNG image has a valid transparency component which is reflected in the Layout View and Design View but NOT the Print Preview. So regardless of what the BackStyle property governs, it behaves differently for Print Preview. If you select BackStyle as Normal for all 3 views it consistently ignores the transparency. However if you select BackStyle as Transparent for all 3 views, it is NOT consistent (that is, Print Preview is different).
    I dabbled with theDBGuy's scenario in hopes of getting a better understanding. The same problem resurfaces. the Print Preview does not behave as expected.

    Since I cannot post images, here are some repro steps.
    1) Obtain or create a PNG image with a known transparency component
    2) Paste it in an Access Report (anywhere is fine) while in Layout or Design View.
    3) Select the Image Control's BackStyle and set to Transparent
    4) Set the background image of the Report to something other than white or use a more complicated image
    5) Observe the transparent portion of the image allows the background image to come through.
    6) Now try to switch to Print Preview and observe the transparent portion of the image NO longer allows the background image to come through.

    Tuesday, December 26, 2017 6:38 PM
  • Hello,

    Thanks for the detail steps. I could reproduce the issue.

    I create a transparent picture according to Make a picture transparent and then insert it into Access report, set BackStyle into Transparent. Then I create a label, set it to back, cover the label with transparent picture.

    In design view:

    In report view and layout view:

    In print preview:

    After some research, It seems to be a limitation of Access.

    Please visit

    https://social.msdn.microsoft.com/Forums/en-US/d2124d5c-97f0-4c2e-93c4-4d67d9055eef/how-do-you-use-transparency-in-images-in-access-2007-reports?forum=innovateonoffice

    https://access.uservoice.com/forums/319956-access-desktop-application/suggestions/11572242-png-transparency-bug-in-ms-access-2003-2007-2010-2 

    Regards,

    Celeste


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, December 27, 2017 3:09 AM
    Moderator
  • RE: the workaround shown in the link above, printing to Microsoft XPS Document Writer does not appear to work for Access 2016, Windows 10 Education. That is, the images still lose their transparency in the Report.

    Friday, December 29, 2017 11:54 PM