Solved

how to display png image in form

Posted on 2014-03-17
16
988 Views
Last Modified: 2014-04-09
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
Comment
Question by:developingprogrammer
  • 8
  • 8
16 Comments
 
LVL 26

Expert Comment

by:MacroShadow
ID: 39933791
It looks like this on my machine.snapshot
0
 

Author Comment

by:developingprogrammer
ID: 39933811
Oops sorry I attached the wrong photo!! Reattaching in 15 min when I get back to my computer!!
0
 

Author Comment

by:developingprogrammer
ID: 39935913
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
 
LVL 26

Assisted Solution

by:MacroShadow
MacroShadow earned 500 total points
ID: 39939520
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
 

Author Comment

by:developingprogrammer
ID: 39949511
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
 
LVL 26

Expert Comment

by:MacroShadow
ID: 39949583
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
 

Author Comment

by:developingprogrammer
ID: 39957987
i see, apologies MacroShadow i must have missed that out! let me go through it again. thanks!! = )
0
 
LVL 26

Expert Comment

by:MacroShadow
ID: 39958116
No problem.
0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

Author Comment

by:developingprogrammer
ID: 39984894
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
 
LVL 26

Accepted Solution

by:
MacroShadow earned 500 total points
ID: 39985167
What happens if you try it with a bmp instead of png?
0
 

Author Comment

by:developingprogrammer
ID: 39985340
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
 
LVL 26

Assisted Solution

by:MacroShadow
MacroShadow earned 500 total points
ID: 39985348
0
 

Author Comment

by:developingprogrammer
ID: 39985410
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
 
LVL 26

Expert Comment

by:MacroShadow
ID: 39985592
No problem.
0
 
LVL 26

Expert Comment

by:MacroShadow
ID: 39985593
Only a few graphics applications support this functionality
I guess Paint isn't one of them.
0
 

Author Comment

by:developingprogrammer
ID: 39988078
ok thanks once again MacroShadow! = )
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now