• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1427
  • Last Modified:

how to display png image in form

hey guys, i have a test database where i'm trying to display a png image in my form. i'm not sure why but i only see the icon instead of the picture itself. i went to search on supported formats and png is indeed a supported format.

here's my empty database with just the table, form and image. could yall help me out? thanks! = )
Pictures.mdb
0
developingprogrammer
Asked:
developingprogrammer
  • 8
  • 8
3 Solutions
 
MacroShadowCommented:
It looks like this on my machine.snapshot
0
 
developingprogrammerAuthor Commented:
Oops sorry I attached the wrong photo!! Reattaching in 15 min when I get back to my computer!!
0
 
developingprogrammerAuthor Commented:
hey guys, here's the correct database where i can't get the png file to show. could yall help me take a look? thanks!! = )
Pictures.mdb
0
Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

 
MacroShadowCommented:
When a user inserts a file using OLE Embedding (eg a png picture - which is what you are doing), Access attempts to invoke the application that is registered for that file-type/extension, and have it store the 'Object' using OLE mechanisms.  Only a few graphics applications support this functionality, and if the registered application does not, a default 'Package' is created (which cannot be displayed directly on a form/report).

In order to display the picture, Access attempts to invoke the application that was used to initially store the object.  If this application is not correctly installed & registered on the user's system, the image will display as an icon.

for more info read this article http://www.ammara.com/articles/accesspictureole.html#S3
0
 
developingprogrammerAuthor Commented:
hrmm i see. thanks for your sharing MacroShadow.

what do you then think is the best way to display this image? i'm thinking put it as the background of a form. is there a better way you can think of? thanks once again in advance!
0
 
MacroShadowCommented:
It's not a question of how you display the picture but rather how the picture is stored. In the aforementioned article you will see there are several ways to store pictures.
0
 
developingprogrammerAuthor Commented:
i see, apologies MacroShadow i must have missed that out! let me go through it again. thanks!! = )
0
 
MacroShadowCommented:
No problem.
0
 
developingprogrammerAuthor Commented:
hi MacroShadow, my apologies for the delay in response!

i read through the article twice and was trying to understand how to fix this situation.

like what you said - "In order to display the picture, Access attempts to invoke the application that was used to initially store the object.  If this application is not correctly installed & registered on the user's system, the image will display as an icon."

what i did was:

1) press print screen
2) open paint
3) press ctrl + v
4) save the image as a png on my desktop
5) double click the image (this opens using Windows Photo Viewer)
6) save the image in my Access database table

what i thought would happen was - since the png file is registered with Windows Photo Viewer, Access would invoke Windows Photo Viewer to display the picture.

however Access is not and it shows as an icon.

so MacroShadow, how can i tell Access to use Paint or Windows Photo Viewer to display the picture?

thanks for your help once again and your very long patience with me!!
0
 
MacroShadowCommented:
What happens if you try it with a bmp instead of png?
0
 
developingprogrammerAuthor Commented:
whao MacroShadow, you're a genius!! it works!!

i guess now for the more in-depth part - why does it work? is it because it's raster not vector so anything can open it?

thanks for your insight and solution MacroShadow! most interested to find out and learn the why behind it = )
0
 
MacroShadowCommented:
0
 
developingprogrammerAuthor Commented:
hrmm MacroShadow, i went through the article and as per the previous post, i thought (like what you shared) because Paint was the programme used to initially store the object that Paint would be invoked to open the object too. hrmm. i still don't understand it but now i know that the solution is to store it as a bmp = ) thanks MacroShadow!!!
0
 
MacroShadowCommented:
No problem.
0
 
MacroShadowCommented:
Only a few graphics applications support this functionality
I guess Paint isn't one of them.
0
 
developingprogrammerAuthor Commented:
ok thanks once again MacroShadow! = )
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 8
  • 8
Tackle projects and never again get stuck behind a technical roadblock.
Join Now